/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #ffffff;
    --secondary-bg: #f8f8f8;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent: #2c2c2c;
    --border: #e0e0e0;
    --max-width: 1200px;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--primary-bg);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.7;
}

/* Header and Navigation */
header {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
    background: var(--primary-bg);
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Main Content */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
    min-height: calc(100vh - 200px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: var(--spacing-lg) 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--spacing-lg);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Page Header */
.page-header {
    text-align: center;
    padding-bottom: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Sections */
section {
    margin-bottom: var(--spacing-lg);
}

section h2 {
    margin-bottom: var(--spacing-md);
}

section h3 {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

/* Lists */
ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Service Grid */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.service-item {
    padding: var(--spacing-md);
    border: 1px solid var(--border);
    background: var(--secondary-bg);
}

.service-item h3 {
    margin-top: 0;
}

/* Gallery */
.gallery-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--border);
    background: var(--secondary-bg);
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent);
    color: white;
    opacity: 1;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    background: var(--secondary-bg);
    border: 1px solid var(--border);
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.gallery-caption {
    padding: 1rem;
}

.gallery-caption p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.gallery-note {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--secondary-bg);
    border-left: 3px solid var(--accent);
}

.gallery-note code {
    background: white;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border);
    font-family: monospace;
}

/* Blog */
.blog-list {
    max-width: 800px;
}

.blog-preview {
    padding-bottom: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

.blog-preview:last-child {
    border-bottom: none;
}

.blog-preview h2 {
    margin-bottom: 0.5rem;
}

.blog-preview h2 a {
    transition: color 0.2s;
}

.blog-preview h2 a:hover {
    color: var(--text-secondary);
    opacity: 1;
}

.post-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.read-more {
    font-weight: 500;
    display: inline-block;
}

/* Single Blog Post */
.blog-post {
    max-width: 800px;
}

.post-header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

.post-content {
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
}

.post-footer {
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
}

.back-link {
    font-weight: 500;
}

/* Full Writeup Article Styles */
.writeup-full {
    max-width: 8.5in;
    margin: 0 auto;
    padding: 1in;
    background: white;
}

.writeup-header {
    margin-bottom: 2rem;
    text-align: left;
}

.writeup-header h1 {
    font-size: 1rem;
    margin-bottom: 0;
    line-height: 2;
    font-weight: 400;
    text-align: center;
}

.writeup-meta {
    font-size: 1rem;
    line-height: 2;
}

.writeup-meta p {
    margin-bottom: 0;
    line-height: 2;
}

.writeup-meta .author {
    font-weight: 400;
    color: var(--text-primary);
}

.writeup-content {
    line-height: 2;
    font-size: 12pt;
    font-family: 'Times New Roman', Times, serif;
}

.writeup-content p {
    margin-bottom: 0;
    text-align: left;
    text-indent: 0.5in;
}

.writeup-content p:first-of-type::first-line {
    text-indent: 0.5in;
}

.writeup-content blockquote {
    margin: 0 0 0 1in;
    padding: 0;
    border-left: none;
    background: transparent;
    font-style: normal;
    text-indent: 0;
    line-height: 2;
}

.writeup-content blockquote p {
    text-indent: 0;
    margin-bottom: 0;
}

.writeup-content blockquote p:last-child {
    margin-bottom: 0;
}

.writeup-content h2 {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 400;
    text-align: center;
    line-height: 2;
}

.writeup-figure {
    margin: 1rem 0;
    text-align: center;
}

.writeup-figure img {
    max-width: 100%;
    height: auto;
    border: none;
    box-shadow: none;
}

.writeup-figure figcaption {
    margin-top: 0.5rem;
    font-size: 12pt;
    color: var(--text-primary);
    font-style: normal;
    font-family: 'Times New Roman', Times, serif;
    line-height: 2;
}

.works-cited {
    margin-top: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.works-cited h2 {
    font-size: 1rem;
    margin-bottom: 0;
    margin-top: 1rem;
    text-align: center;
    font-weight: 400;
    line-height: 2;
}

.works-cited p {
    margin-bottom: 0;
    padding-left: 0.5in;
    text-indent: -0.5in;
    font-size: 12pt;
    line-height: 2;
    text-align: left;
    font-family: 'Times New Roman', Times, serif;
}

.works-cited a {
    color: var(--text-primary);
    text-decoration: none;
    word-break: break-word;
}

.works-cited a:hover {
    text-decoration: underline;
}

.writeup-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Contact Page */
.contact-content {
    max-width: 800px;
}

.contact-methods h2 {
    margin-bottom: var(--spacing-md);
}

.contact-list {
    display: grid;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.contact-item {
    padding: var(--spacing-md);
    border: 1px solid var(--border);
    background: var(--secondary-bg);
}

.contact-item h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
}

.contact-item p {
    margin-bottom: 0.5rem;
}

.contact-item p:last-child {
    margin-bottom: 0;
}

.contact-item a {
    color: var(--accent);
    text-decoration: underline;
    word-break: break-all;
}

.contact-item a:hover {
    opacity: 0.7;
}

.contact-item strong {
    font-family: monospace;
    background: white;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border);
}

.contact-note {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--secondary-bg);
    border-left: 3px solid var(--accent);
}

.contact-note h3 {
    margin-top: 0;
}

.contact-note h4 {
    margin-top: var(--spacing-md);
    margin-bottom: 0.5rem;
}

.contact-info h3 {
    margin-top: var(--spacing-md);
}

/* Forms */
.contact-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    background: var(--primary-bg);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

textarea {
    resize: vertical;
}

.submit-btn,
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.submit-btn:hover,
.btn:hover {
    opacity: 0.8;
}

/* Messages */
.success-message,
.error-message {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-left: 3px solid;
}

.success-message {
    background: #f0f9f0;
    border-color: #4caf50;
}

.error-message {
    background: #fff3f3;
    border-color: #f44336;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: var(--spacing-md) 0;
    background: var(--secondary-bg);
    margin-top: var(--spacing-lg);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-content p {
    margin-bottom: 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    main {
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .service-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .filter-btn {
        flex: 1;
        text-align: center;
    }
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    font-weight: 300;
    line-height: 1;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 0.7;
}
