/* =============================================
   Vermont Paint Works - Main Stylesheet
   Mobile-first responsive design
   ============================================= */

/* -----------------------------------------
   CSS Custom Properties (Design Tokens)
   ----------------------------------------- */
:root {
    /* Colors */
    --color-primary: rgb(26, 84, 56);
    --color-primary-dark: #132c20;
    --color-accent: #c4693a;
    --color-text: #361a15;
    --color-text-light: #64748b;
    --color-bg: #f6f3f0;
    --color-bg-white: #fff;
    --color-bg-light: #f8fafc;
    --color-bg-dark: #f1f5f9;
    --color-border: #e2e8f0;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --line-height: 1.6;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Layout */
    --max-width: 1200px;
    --header-height: 70px;
    --radius: 6px;
    --transition: 0.3s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: var(--line-height);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-primary-dark);
}

/* -----------------------------------------
   Typography
   ----------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}

h1 {
    font-size: 1.75rem;
    margin-bottom: var(--space-md);
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: var(--space-sm);
}

/* -----------------------------------------
   Layout
   ----------------------------------------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

/* -----------------------------------------
   Header & Navigation
   ----------------------------------------- */
.site-header {
    background-color: var(--color-bg);
    box-shadow: var(--shadow-sm);
    position: static;
    left: 0;
    right: 0;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.site-header .container {
    height: 100%;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    gap: var(--space-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: clamp(0.25rem, 0.8vw, 0.5rem);
}

.logo a {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.logo a:hover {
    color: var(--color-primary-dark);
}

.logo img {
    height: auto;
    max-height: 50px;
    width: auto;
}

/* Mobile Navigation */
.nav-links {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: var(--color-bg);
    flex-direction: column;
    box-shadow: var(--shadow-md);
    list-style: none;
    z-index: 1001;
}

.nav-links.active {
    display: flex;
    border-radius: 4px;
    right: 0;
    position: fixed;
    margin-left: auto;
    width: 80%;
}

.nav-links li {
    width: 100%;
}

.nav-links a {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--color-text);
    font-weight: 500;
    white-space: nowrap;
    border-radius: 4px;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--color-primary);
}

.active-tab a {
    background-color: var(--color-accent);
    color: white;
}

.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition);
}

/* -----------------------------------------
   Hero Section
   ----------------------------------------- */
.hero {
    position: relative;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("../images/hero.jpg");
    margin: 0;
    /* Remove default body margin */
    padding-top: var(--header-height);
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    color: white;
    width: 100%;
    text-align: center;
    /* animation: fadeIn .1s ease-in forwards; */
    aspect-ratio: 5 / 4;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 0;
}

.hero h1 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: var(--space-md);
    animation: slideUp 0.3s ease-out forwards;
}

.hero-subtitle {
    font-size: 1.125rem;
    margin-bottom: var(--space-lg);
    opacity: 0.95;
    animation: slideUp 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* -----------------------------------------
   Page Header
   ----------------------------------------- */
.page-header {
    padding: var(--space-xl) 0;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    background-color: #1f3d2b;
}

.page-header h1 {
    color: #f7f1e2;
    margin-bottom: var(--space-sm);
    animation: slideUp 0.8s ease-out forwards;
}

.page-header p {
    font-size: 1.125rem;
    color: #f7f1e2;
    animation: slideUp 0.8s ease-out forwards;
}

/* -----------------------------------------
   Buttons
   ----------------------------------------- */
.cta-button,
.submit-button {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    border: 2px solid transparent;
}

.cta-button {
    background-color: var(--color-accent);
    color: white;
}

.cta-button:hover {
    background-color: var(--color-bg-light);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.submit-button {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    width: 100%;
}

.submit-button:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

/* -----------------------------------------
   Content Sections
   ----------------------------------------- */
.features,
.content-section,
.services-section,
.contact-section {
    padding: var(--space-2xl) 0;
}

.features h2,
.content-section h2,
.services-section h2 {
    text-align: center;
    margin-bottom: var(--space-xl);
}

/* -----------------------------------------
   Content Grid (About Page)
   ----------------------------------------- */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

.content-media {
    display: flex;
    align-items: center;
}

.section-media {
    margin: var(--space-lg) 0;
}

.section-image {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.about-section-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.about-figure {
    margin: 0;
    position: relative;
    width: 100%;
}

.about-caption {
    position: absolute;
    left: 12px;
    bottom: 12px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 10px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    line-height: 1;
    max-width: calc(100% - 24px);
    box-shadow: var(--shadow-md);
    transition: transform 160ms ease;
}

.about-figure:hover .about-caption {
    transform: translateY(-2px);
}

.content-text h2 {
    text-align: left;
}

/* -----------------------------------------
   Services Grid
   ----------------------------------------- */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.service-card {
    background: var(--color-bg-white);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    text-align: left;
    transition: box-shadow var(--transition);
    padding: 1em;
}

.service-card:hover {
    box-shadow: var(--shadow-md);
}

.service-card h2 {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
    text-align: left;
}

.service-card ul {
    list-style: disc;
    list-style-position: inside;
    padding: 0 2px;
    margin-top: var(--space-md);
}

.service-card ul li {
    padding: var(--space-xs) 0;
}

/* -----------------------------------------
   Gallery Grid
   ----------------------------------------- */
.gallery-grid {
    column-count: 2;
    column-gap: var(--space-sm);
    margin: 1rem;
    line-height: 0;
}

.gallery-item {
    display: inline-block;
    width: 100%;
    background: var(--color-bg-white);
    overflow: hidden;
    text-align: center;
    break-inside: avoid;
    position: relative;
    margin: 0 0 var(--space-sm);
    vertical-align: top;
    line-height: var(--line-height);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.image-label {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: rgba(26, 84, 56, 0.9);
    color: var(--color-bg-white);
    padding: var(--space-xs) var(--space-md);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
}

/* -----------------------------------------
   Gallery Category
   ----------------------------------------- */
.gallery-category {
    scroll-margin-top: calc(var(--header-height) + var(--space-md));
}

.gallery-category h2 {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-sm);
    color: var(--color-primary);
    font-size: 2rem;
    font-weight: 700;
}

/* -----------------------------------------
   Tab Navigation
   ----------------------------------------- */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    border-bottom: 2px solid var(--color-border);
}

.tab-button {
    padding: var(--space-md) var(--space-xl);
    background: transparent;
    color: var(--color-text);
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    bottom: -2px;
}

.tab-button:hover {
    color: var(--color-primary);
}

.tab-button.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* -----------------------------------------
   Lightbox Modal
   ----------------------------------------- */
.lightbox-modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    opacity: 0;
    transition: opacity var(--transition);
}

.lightbox-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--color-text);
    transition: background var(--transition);
    z-index: 10001;
}

.lightbox-close:hover {
    background: white;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--color-text);
    transition: background var(--transition);
    z-index: 10001;
}

.lightbox-nav:hover {
    background: white;
}

.lightbox-nav.prev {
    left: 10px;
}

.lightbox-nav.next {
    right: 10px;
}

/* -----------------------------------------
   Contact Section
   ----------------------------------------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

.contact-info h2,
.contact-form-wrapper h2 {
    margin-bottom: var(--space-md);
}

.contact-details {
    margin-top: var(--space-lg);
}

.contact-item {
    margin-bottom: var(--space-lg);
}

.contact-item h3 {
    font-size: 1rem;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
}

.contact-item p {
    margin: 0;
}

.contact-item a {
    color: var(--color-text);
    transition: color var(--transition);
}

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

/* -----------------------------------------
   Forms
   ----------------------------------------- */
.contact-form {
    background-color: var(--color-bg-light);
    padding: var(--space-lg);
    border-radius: 8px;
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 500;
    color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color var(--transition);
}

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

.form-hint {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

/* -----------------------------------------
   CTA Section
   ----------------------------------------- */
.cta-section {
    background-color: var(--color-primary-dark);
    padding: var(--space-2xl) 0;
    text-align: center;
}

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

.cta-section p {
    font-size: 1.125rem;
    margin-bottom: var(--space-lg);
    color: rgba(255, 255, 255, 0.9);
}

.cta-section .cta-button {
    background-color: var(--color-accent);
    color: white;
}

.cta-section .cta-button:hover {
    background-color: var(--color-primary-dark);
}

.site-footer {
    background-color: var(--color-bg);
    padding: var(--space-md) 0 var(--space-sm);
    font-size: 0.95rem;
}

/* Mobile-first: stack logo and contact, left-aligned */
.footer-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.footer-info h3,
.footer-links h4,
.footer-contact h4 {
    color: var(--color-text);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.footer-tag {
    margin-bottom: 0.5rem;
    color: var(--color-text-light);
    font-weight: 500;
}

.footer-info p {
    color: var(--color-text);
}

.footer-info img {
    height: auto;
    max-height: 60px;
    width: auto;
    margin-top: 0.5rem;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding-left: 0;
    margin: 0;
    align-items: center;
}

.footer-links ul li {
    margin: 0;
}

.footer-links a {
    color: var(--color-text);
    transition: color var(--transition);
    padding: 0.125rem 0.25rem;
}

.footer-links a:hover {
    color: var(--color-primary);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.footer-contact .contact-line a {
    color: var(--color-text);
}

.footer-cta {
    display: inline-block;
    padding: 0.45rem 0.75rem;
    background: var(--color-accent);
    color: white;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition);
    cursor: pointer;
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    text-align: center;
}

.footer-cta:hover {
    background: var(--color-primary-dark);
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-sm);
    border-top: 1px solid rgba(0,0,0,0.06);
}

.footer-bottom p {
    margin: 0;
    color: var(--color-text-light);
    font-size: 0.95rem;
}

/* =============================================
   Tablet Breakpoint (768px+)
   ============================================= */
@media (min-width: 768px) {
    :root {
        --header-height: 80px;
        --space-xl: 3rem;
        --space-2xl: 4rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 2rem;
    }

    .container {
        padding: 0 var(--space-md);
    }

    
    .nav-desktop-color {
        color: var(--color-bg) !important;
    }

    .nav-links {
        display: flex;
        position: static;
        flex-direction: row;
        gap: clamp(1px, 1vw, 2px);
        align-items: center;
        box-shadow: none;
        padding: 2vw;
        background-color: transparent;
    }

    .nav-links li {
        width: auto;
    }

    .nav-links a {
        padding: 10px;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .logo a {
        font-size: 1.5rem;
    }

    .logo img {
        max-height: 60px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    /* Multi-column layouts */
    .gallery-grid {
        column-count: 3;
        column-gap: var(--space-md);
    }

    .gallery-item {
        margin: 0 0 var(--space-md);
    }

    .content-grid {
        grid-template-columns: 1.5fr 1fr 1fr;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .contact-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .lightbox-close {
        top: 20px;
        right: 20px;
    }

    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .lightbox-nav.prev {
        left: 20px;
    }

    .lightbox-nav.next {
        right: 20px;
    }

    .footer-content {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: var(--space-md);
        margin-bottom: var(--space-sm);
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .footer-info img {
        margin-top: 0;
    }

    /* Keep the email and button stacked vertically, but place that stack to the right of the logo */
    .footer-contact {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .footer-contact .contact-line {
        margin: 0;
    }

    .footer-cta {
        width: auto;
        max-width: 260px;
        padding: 0.4rem 0.65rem;
        font-size: 0.95rem;
    }
}

/* =============================================
   Desktop Breakpoint (1024px+)
   ============================================= */
@media (min-width: 1024px) {
    h1 {
        font-size: 2.5rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .nav-links-index a {
        color: var(--color-bg);
    }

    .nav-links-index ul li a {
        color: var(--color-bg);
    }
}

/* =============================================
   Accessibility
   ============================================= */
@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;
    }
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}