/* ============================================
   ERIC COSTE - AUTHOR WEBSITE
   Brutalist Style CSS
   Mobile-first responsive design
   ============================================ */

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

html {
    scroll-behavior: smooth;
    /* Offset for sticky header when scrolling to anchors */
    scroll-padding-top: 80px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #000;
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Utility Classes ---------- */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

p {
    margin-bottom: 1em;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: #000;
    text-decoration: underline;
    text-underline-offset: 3px;
}

a:hover {
    text-decoration-thickness: 3px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    border: 3px solid #000;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}

.btn-primary {
    background-color: #000;
    color: #fff;
}

.btn-primary:hover {
    background-color: #333;
}

.btn-secondary {
    background-color: #fff;
    color: #000;
}

.btn-secondary:hover {
    background-color: #000;
    color: #fff;
}

.btn-disabled {
    background-color: #ddd;
    color: #666;
    border-color: #999;
    cursor: not-allowed;
}

/* ---------- Header ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #fff;
    border-bottom: 3px solid #000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 20px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #000;
    transition: transform 0.2s, opacity 0.2s;
}

/* Menu toggle active state */
.menu-toggle.active .menu-bar:nth-child(1) {
    transform: translateY(9.5px) rotate(45deg);
}

.menu-toggle.active .menu-bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .menu-bar:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
}

/* Navigation */
.nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border-bottom: 3px solid #000;
    padding: 20px;
}

.nav.active {
    display: block;
}

.nav-link {
    display: block;
    padding: 12px 0;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    border-bottom: 1px solid #ddd;
}

.nav-link:last-child {
    border-bottom: none;
}

.nav-link:hover {
    text-decoration: underline;
    text-decoration-thickness: 3px;
}

/* ---------- Hero Section ---------- */
.hero {
    padding: 80px 0 100px;
    border-bottom: 3px solid #000;
}

.hero-title {
    font-size: clamp(32px, 8vw, 56px);
    margin-bottom: 20px;
    max-width: 800px;
}

.hero-subtitle {
    font-size: clamp(18px, 4vw, 22px);
    margin-bottom: 40px;
    max-width: 600px;
    color: #333;
}

/* ---------- Sections ---------- */
.section {
    padding: 80px 0;
    border-bottom: 3px solid #000;
}

.section-alt {
    background-color: #f5f5f5;
}

.section-title {
    font-size: clamp(28px, 6vw, 42px);
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* ---------- Books Grid ---------- */
.books-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.book-card {
    border: 3px solid #000;
    padding: 25px;
    background-color: #fff;
}

.book-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    margin-bottom: 20px;
    border: 2px solid #000;
    overflow: hidden;
    background-color: #eee;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-title {
    font-size: 22px;
    margin-bottom: 10px;
}

.book-tagline {
    font-size: 16px;
    color: #333;
    margin-bottom: 20px;
}

.book-card .btn {
    width: 100%;
    text-align: center;
}

/* ---------- About Section ---------- */
.about-content {
    max-width: 700px;
}

.about-content p {
    font-size: 18px;
    line-height: 1.7;
}

/* ---------- Newsletter Section ---------- */
.newsletter-intro {
    font-size: 18px;
    margin-bottom: 30px;
    color: #333;
}

.newsletter-form {
    max-width: 500px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 18px;
    font-family: inherit;
    border: 3px solid #000;
    background-color: #fff;
    outline: none;
}

.form-input:focus {
    background-color: #f5f5f5;
}

.form-input::placeholder {
    color: #666;
}

.form-message {
    margin-top: 15px;
    font-size: 16px;
    font-weight: 700;
}

.form-message.success {
    color: #000;
}

.form-message.error {
    color: #900;
}

/* ---------- Contact Section ---------- */
#contact p {
    margin-bottom: 20px;
}

#contact .btn {
    text-transform: none;
    letter-spacing: 0;
}

/* ---------- Nav Button (Contact) ---------- */
.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* ---------- Contact Modal ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background-color: #fff;
    border: 3px solid #000;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px 30px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
}

.modal-close:hover {
    background-color: #000;
    color: #fff;
}

.modal-title {
    font-size: 28px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.modal-intro {
    margin-bottom: 30px;
    color: #333;
}

.contact-form .form-field {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.btn-full {
    width: 100%;
    text-align: center;
}

/* ---------- Footer ---------- */
.footer {
    padding: 40px 0;
    text-align: center;
}

.footer-copyright {
    font-size: 14px;
    margin-bottom: 10px;
}

.footer-link {
    font-size: 14px;
}

/* ============================================
   RESPONSIVE STYLES - Tablet and up
   ============================================ */
@media (min-width: 600px) {
    /* Books grid - 2 columns */
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    /* Newsletter form - horizontal layout */
    .form-group {
        flex-direction: row;
    }
    
    .form-input {
        flex: 1;
    }
    
    .newsletter-form .btn {
        white-space: nowrap;
    }
}

/* ============================================
   RESPONSIVE STYLES - Desktop
   ============================================ */
@media (min-width: 900px) {
    body {
        font-size: 19px;
    }
    
    /* Header - horizontal navigation */
    .header-inner {
        padding: 20px 40px;
    }
    
    .menu-toggle {
        display: none;
    }
    
    .nav {
        display: flex;
        position: static;
        border-bottom: none;
        padding: 0;
        gap: 30px;
    }
    
    .nav-link {
        display: inline;
        padding: 0;
        font-size: 14px;
        border-bottom: none;
    }
    
    /* Hero adjustments */
    .hero {
        padding: 120px 0 140px;
    }
    
    /* Sections */
    .section {
        padding: 100px 0;
    }
    
    /* Books grid - 3 columns */
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 35px;
    }
    
    .book-card {
        padding: 30px;
    }
}

/* ============================================
   RESPONSIVE STYLES - Large Desktop
   ============================================ */
@media (min-width: 1200px) {
    .container {
        max-width: 1000px;
    }
    
    .header-inner {
        max-width: 1400px;
    }
}

/* ---------- Print Styles ---------- */
@media print {
    .header,
    .menu-toggle,
    .btn,
    .newsletter-form {
        display: none;
    }
    
    body {
        font-size: 12pt;
    }
    
    .section {
        border-bottom: 1px solid #000;
        padding: 20px 0;
    }
}
