/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* UX & Accessibility Enhancements */
.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;
}

.required-mark {
    color: #d32f2f;
    margin-left: 0.25rem;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #4a3728;
    color: #fff;
    padding: 8px 16px;
    z-index: 1000;
    transition: top 0.2s;
    text-decoration: none;
    font-weight: bold;
    border-radius: 0 0 5px 0;
}

.skip-link:focus {
    top: 0;
}

.spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

a, button, .btn, input, textarea {
    transition: all 0.2s ease-in-out;
}

/* Header and Navigation */
header {
    background-color: #4a3728;
    color: #fff;
    text-align: center;
    padding: 1rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.site-title {
    color: inherit;
    text-decoration: none;
    display: inline-block;
}

.site-title:hover {
    opacity: 0.9;
}

.site-title:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
    border-radius: 4px;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
}

nav a:hover {
    color: #d4a373;
}

nav a.active,
nav a[aria-current="page"] {
    border-bottom: 2px solid #d4a373;
}

/* Hero Section */
.hero {
    position: relative;
    text-align: center;
}

.hero-image {
    width: 100%;
    height: 600px;
    object-fit: cover;
}

.hero-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.5);
    padding: 2rem;
    color: #fff;
}

.hero-text h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #d4a373;
    color: #4a3728;
    text-decoration: none;
    border-radius: 5px;
}

.btn:hover {
    background-color: #b88a5a;
}

.btn:disabled, button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    filter: grayscale(30%);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
    width: 100%;
}

section {
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.8rem;
    color: #4a3728;
    margin-bottom: 1rem;
}

.content-image {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 5px;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.service-item {
    text-align: center;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
}

/* Image Hover Effect */
.hover-effect {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hover-effect:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Contact Form */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 500px;
    margin: 1rem 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.input-hint {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.2rem;
}

label {
    font-weight: bold;
}

input, textarea {
    padding: 0.5rem;
    border: 1px solid #767676;
    border-radius: 5px;
}

input:hover, textarea:hover {
    border-color: #4a3728;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

button {
    align-self: flex-start;
    cursor: pointer;
}

/* Footer */

footer {
    flex-shrink: 0; /* Prevents footer from shrinking */
    background-color: #4a3728;
    color: #fff;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: auto; /* Ensures it pushes to bottom if flex fails or as fallback */
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #d4a373;
    text-decoration: underline;
}


@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .hero-image {
        height: 300px;
    }

    .hero-text h2 {
        font-size: 1.5rem;
    }
}

/* Focus Visibility for Keyboard Accessibility */
:focus-visible {
    outline: 2px solid #4a3728;
    outline-offset: 2px;
}

header :focus-visible,
footer :focus-visible,
.hero :focus-visible {
    outline-color: #fff;
}

input:focus, textarea:focus {
    border-color: #4a3728;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 55, 40, 0.2);
}


/* Form Status Messages */
.status-message {
    padding: 10px;
    margin-top: 10px;
    border-radius: 5px;
    font-weight: bold;
    display: none; /* Hidden by default */
}

.status-message.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
