/*
 * style.css
 * Custom stylesheet for Dude and His Wood website.
 * Recreates the original design without Tailwind CSS or Alpine.js.
 */

/* 1. Global Styles & Variables
-------------------------------------------------- */

:root {
    --font-primary: 'Inter', sans-serif;
    --font-headings: 'Roboto Slab', serif;
    --color-background: #F8F4F0; /* Light beige */
    --color-text: #4A4A4A; /* Dark gray */
    --color-headings: #2d2d2d; /* Darker gray for headings */
    --color-dark: #2d2520; /* Stone-800 equivalent */
    --color-darker: #1c1917; /* Stone-900 equivalent */
    --color-primary: #f59e0b; /* Amber-500 */
    --color-primary-dark: #d97706; /* Amber-600 */
    --color-light-gray: #e5e7eb; /* Gray-200 for borders */
    --color-white: #ffffff;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    color: var(--color-headings);
    line-height: 1.2;
}

p {
    margin-bottom: 1rem;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.text-center {
    text-align: center;
}

.content-section {
    padding-top: 5rem;
    padding-bottom: 5rem;
    scroll-margin-top: 70px; /* Offset for sticky header */
}

/* 2. Header & Navigation
-------------------------------------------------- */
.main-header {
    background-color: var(--color-dark);
    color: var(--color-white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.main-nav {
    display: none; /* Hidden on mobile */
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-size: 1.125rem;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-button {
    background-color: var(--color-primary);
    color: var(--color-dark);
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.nav-button:hover {
    background-color: var(--color-primary-dark);
    color: var(--color-dark);
    transform: scale(1.05);
}

/* Mobile Menu Logic (Checkbox Hack) */
.menu-toggle {
    display: none; /* Hide the checkbox */
}

.hamburger-menu {
    display: flex; /* Display on mobile */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    cursor: pointer;
}

.hamburger-line {
    width: 30px;
    height: 2px;
    background-color: var(--color-white);
    display: block;
    transition: all 0.3s ease-in-out;
}

/* Transform hamburger to "X" when menu is open */
.menu-toggle:checked ~ .hamburger-menu .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle:checked ~ .hamburger-menu .hamburger-line:nth-child(2) {
    opacity: 0;
}
.menu-toggle:checked ~ .hamburger-menu .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Show mobile nav when checkbox is checked */
.menu-toggle:checked ~ .main-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-dark);
    padding-bottom: 1rem;
}
.main-nav a {
    text-align: center;
    padding: 1rem 0;
    width: 100%;
}
.main-nav a:hover {
    background-color: var(--color-darker);
}
.main-nav .nav-button {
    margin: 1rem auto 0;
    width: calc(100% - 2rem);
}

/* 3. Hero Section
-------------------------------------------------- */
.hero {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://placehold.co/1920x1080/8B4513/FFFFFF?text=Dude+and+His+Wood');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 100vh;
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content {
    padding: 1rem;
    max-width: 800px;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-white);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1.125rem;
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: inline-block;
}

.btn:hover {
    transform: scale(1.05);
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-dark);
}
.btn-primary:hover {
    background-color: var(--color-primary-dark);
}

.btn-dark {
    background-color: var(--color-dark);
    color: var(--color-white);
    width: 100%;
    border: none;
    cursor: pointer;
}
.btn-dark:hover {
    background-color: var(--color-darker);
}


/* 4. Content Sections (About, Services, etc.)
-------------------------------------------------- */

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

.rounded-image {
    border-radius: 8px;
}
.shadow-xl {
    box-shadow: var(--shadow-xl);
}

.about-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}
.about-text-wrapper h2 {
    margin-bottom: 1.5rem;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.service-card {
    background-color: var(--color-white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.service-icon {
    color: var(--color-primary);
    margin-bottom: 1rem;
}
.service-icon svg {
    width: 4rem;
    height: 4rem;
    margin: 0 auto;
}
.service-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* 5. Gallery & Modal
-------------------------------------------------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: block;
}
.gallery-item img {
    transition: transform 0.3s ease;
}
.gallery-item:hover img {
    transform: scale(1.05);
}

/* Pure CSS Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.modal:target {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: default;
}

.modal-content {
    position: relative;
    background: var(--color-white);
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    max-width: 90%;
    max-height: 90%;
}
.modal-content img {
    max-width: 100%;
    max-height: calc(90vh - 2rem);
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--color-white);
    color: var(--color-dark);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
}

/* 6. CTA Section
-------------------------------------------------- */
.cta-section {
    background-color: var(--color-dark);
    color: var(--color-white);
    border-radius: 8px;
    padding: 4rem 2rem;
    text-align: center;
    margin: 5rem 0;
}
.cta-section h2 {
    color: var(--color-white);
    font-size: 2.25rem;
}
.cta-section p {
    font-size: 1.25rem;
    color: #d4d4d8; /* stone-300 */
    margin-bottom: 2rem;
}

/* 7. Contact Form
-------------------------------------------------- */
.contact-form-wrapper {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--color-white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-light-gray);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 1rem;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

/* 8. Footer
-------------------------------------------------- */
.main-footer-bottom {
    background-color: var(--color-darker);
    color: #a1a1aa; /* stone-400 */
    padding: 4rem 0;
}
.main-footer-bottom .logo {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--color-white);
}
.main-footer-bottom p {
    margin-bottom: 1rem;
}
.social-links {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.social-links a {
    transition: color 0.3s ease;
}
.social-links a:hover {
    color: var(--color-primary);
}
.copyright {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}
.copyright a {
    text-decoration: underline;
}
.copyright a:hover {
    color: var(--color-primary);
}


/* 9. Responsive Breakpoints
-------------------------------------------------- */

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    html { font-size: 17px; }

    h1 { font-size: 4rem; }
    .section-title { font-size: 3rem; }

    .hamburger-menu { display: none; }
    .main-nav { display: flex; }
    .menu-toggle:checked ~ .main-nav {
        position: static;
        flex-direction: row;
        width: auto;
        background-color: transparent;
        padding-bottom: 0;
    }

    .about-section { grid-template-columns: 2fr 3fr; }
    .services-grid { grid-template-columns: repeat(3, 1fr); }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
