/* Rebecca Cary-Anderson Website - Main Stylesheet */

:root {
    --white-hsl: 0, 0%, 98%;
    --black-hsl: 0, 0%, 0%;
    --max-page-width: 1400px;
    --page-padding: 5vw;
    --header-vert-padding: 3vw;
    --mobile-header-vert-padding: 6vw;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'adobe-garamond-pro', 'Georgia', serif;
    color: hsl(var(--black-hsl));
    background: hsl(var(--white-hsl));
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-size: 18px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'orpheus-pro', 'Georgia', serif;
    font-weight: 400;
    line-height: 1.2;
}

h1 {
    font-size: 3em;
    margin: 0.5em 0;
}

h2 {
    font-size: 2em;
    margin: 0.75em 0;
}

h3 {
    font-size: 1.5em;
    margin: 0.5em 0;
}

a {
    color: hsl(var(--black-hsl));
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.6;
}

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

/* Header */
.header {
    padding: var(--header-vert-padding) var(--page-padding);
    max-width: var(--max-page-width);
    margin: 0 auto;
    position: relative;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2em;
}

.header-logo {
    height: 160px;
    width: auto;
    transition: all 0.3s ease;
}

.header-nav {
    display: flex;
    gap: 2em;
    align-items: center;
    flex-wrap: wrap;
}

.header-nav a {
    font-size: 1em;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: none;
}

.header-social {
    display: flex;
    gap: 1em;
    align-items: center;
}

.header-social a {
    display: inline-block;
    width: 24px;
    height: 24px;
}

.header-social svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5em;
    font-size: 1.5em;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: hsl(var(--black-hsl));
    margin: 5px 0;
    transition: 0.3s;
}

/* Main Content */
.main-content {
    max-width: var(--max-page-width);
    margin: 0 auto;
    padding: 0 var(--page-padding);
    min-height: 60vh;
}

.page-title {
    text-align: center;
    margin: 2em 0;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3vw 2vw;
    margin: 3em 0;
}

.book-item {
    text-align: center;
    transition: transform 0.3s ease;
}

.book-item:hover {
    transform: translateY(-5px);
}

.book-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    margin-bottom: 1em;
}

.book-item h3 {
    font-size: 1.2em;
    margin: 0.5em 0;
    font-weight: 400;
}

/* About Page */
.about-content {
    max-width: 800px;
    margin: 3em auto;
    text-align: center;
    line-height: 1.8;
    font-size: 1.1em;
}

.about-content img {
    margin: 2em auto;
    max-width: 600px;
}

/* Contact Page */
.contact-form {
    max-width: 600px;
    margin: 3em auto;
}

.form-group {
    margin-bottom: 1.5em;
}

.form-group label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75em;
    border: 1px solid #ccc;
    font-family: inherit;
    font-size: 1em;
}

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

.submit-button {
    background: hsl(var(--black-hsl));
    color: hsl(var(--white-hsl));
    border: none;
    padding: 1em 2em;
    font-size: 1em;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.submit-button:hover {
    opacity: 0.8;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3em var(--page-padding);
    margin-top: 5em;
    border-top: 1px solid #eee;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 1.5em;
    margin: 1em 0;
}

.footer-social a {
    display: inline-block;
    width: 30px;
    height: 30px;
}

.footer p {
    margin: 0.5em 0;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: var(--mobile-header-vert-padding) var(--page-padding);
    }

    .header-logo {
        height: 70px;
    }

    .header-nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: hsl(var(--white-hsl));
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2em;
        z-index: 9999;
    }

    .header-nav.active {
        display: flex;
    }

    .header-nav a {
        font-size: 1.5em;
    }

    .mobile-menu-toggle {
        display: block;
        z-index: 10000;
    }

    .books-grid {
        grid-template-columns: 1fr;
        gap: 2em;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.5em;
    }

    .about-content {
        font-size: 1em;
    }
}

/* Admin/CMS Styles */
.admin-panel {
    max-width: 1200px;
    margin: 2em auto;
    padding: 0 var(--page-padding);
}

.admin-header {
    background: hsl(var(--black-hsl));
    color: hsl(var(--white-hsl));
    padding: 1.5em;
    margin-bottom: 2em;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.5em;
}

.admin-nav {
    display: flex;
    gap: 1em;
    margin-top: 1em;
}

.admin-nav a {
    color: hsl(var(--white-hsl));
    padding: 0.5em 1em;
    border: 1px solid hsl(var(--white-hsl));
}

.admin-nav a:hover,
.admin-nav a.active {
    background: hsl(var(--white-hsl));
    color: hsl(var(--black-hsl));
}

.content-list {
    list-style: none;
    padding: 0;
}

.content-item {
    border: 1px solid #ddd;
    padding: 1.5em;
    margin-bottom: 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-item-actions {
    display: flex;
    gap: 0.5em;
}

.btn {
    padding: 0.5em 1em;
    border: 1px solid hsl(var(--black-hsl));
    background: none;
    cursor: pointer;
    font-size: 0.9em;
}

.btn:hover {
    background: hsl(var(--black-hsl));
    color: hsl(var(--white-hsl));
}

.btn-primary {
    background: hsl(var(--black-hsl));
    color: hsl(var(--white-hsl));
}

.btn-primary:hover {
    opacity: 0.8;
}

.editor-container {
    border: 1px solid #ddd;
    padding: 1.5em;
    margin: 2em 0;
}

.image-upload-area {
    border: 2px dashed #ccc;
    padding: 2em;
    text-align: center;
    margin: 1em 0;
    cursor: pointer;
}

.image-upload-area:hover {
    background: #f9f9f9;
}

.image-preview {
    max-width: 300px;
    margin: 1em 0;
}

/* Book Detail Page Styles */
.book-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4em var(--page-padding);
}

.book-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4em;
    align-items: start;
}

.book-detail-image img {
    width: 100%;
    height: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.book-detail-info h1 {
    font-size: 2.5em;
    margin-top: 0;
}

.book-description {
    margin: 2em 0;
    line-height: 1.8;
}

.book-description p {
    margin: 1em 0;
}

.book-actions {
    display: flex;
    gap: 1em;
    margin-top: 2em;
}

.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 1em 2em;
    text-decoration: none;
    border-radius: 4px;
    font-family: 'adobe-garamond-pro', 'Georgia', serif;
    font-size: 1em;
    transition: all 0.3s ease;
}

.btn-primary {
    background: hsl(var(--black-hsl));
    color: hsl(var(--white-hsl));
}

.btn-primary:hover {
    background: hsl(0, 0%, 20%);
}

.btn-secondary {
    background: transparent;
    color: hsl(var(--black-hsl));
    border: 1px solid hsl(var(--black-hsl));
}

.btn-secondary:hover {
    background: hsl(var(--black-hsl));
    color: hsl(var(--white-hsl));
}

@media (max-width: 768px) {
    .book-detail-content {
        grid-template-columns: 1fr;
        gap: 2em;
    }

    .book-detail-info h1 {
        font-size: 2em;
    }

    .book-actions {
        flex-direction: column;
    }

    .btn-primary, .btn-secondary {
        text-align: center;
    }
}

/* Book Detail Full Layout with Gallery */
.book-detail-full {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3em var(--page-padding);
}

.book-hero {
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 6vw;
    align-items: start;
    margin-bottom: 4em;
}

.book-hero-image img {
    width: 100%;
    height: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.book-hero-image a:hover img {
    transform: scale(1.02);
}

.book-hero-content h1 {
    font-size: 3em;
    margin-top: 0;
    margin-bottom: 0.5em;
}

.book-hero-content p {
    line-height: 1.8;
    margin: 1.5em 0;
}

.book-hero-content a {
    color: hsl(var(--black-hsl));
    text-decoration: underline;
}

.book-hero-content a:hover {
    opacity: 0.7;
}

/* Book Gallery Grid */
.book-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2vw;
    margin-bottom: 4em;
}

/* Horizontal Gallery */
.gallery-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1em;
    width: 100%;
}

.gallery-horizontal {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 3vw) / 2.5);
    gap: 2vw;
    overflow-x: hidden;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.gallery-horizontal .gallery-item {
    width: 100%;
}

.gallery-horizontal .gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Gallery Navigation Arrows */
.gallery-nav {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: hsl(var(--white-hsl));
    border: 2px solid hsl(var(--black-hsl));
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.gallery-nav:hover {
    background: hsl(var(--black-hsl));
    transform: scale(1.1);
}

.gallery-nav:hover svg {
    stroke: hsl(var(--white-hsl));
}

.gallery-nav svg {
    width: 20px;
    height: 20px;
    stroke: hsl(var(--black-hsl));
    transition: stroke 0.3s ease;
}

.gallery-nav:disabled,
.gallery-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.gallery-nav.disabled:hover {
    background: hsl(var(--white-hsl));
    transform: none;
}

.gallery-nav.disabled svg {
    stroke: rgba(0, 0, 0, 0.3);
}

/* Responsive Gallery */
@media (max-width: 768px) {
    .gallery-wrapper {
        gap: 0.5em;
    }

    .gallery-nav {
        width: 32px;
        height: 32px;
    }

    .gallery-nav svg {
        width: 16px;
        height: 16px;
    }

    .gallery-horizontal {
        grid-auto-columns: 100%;
        gap: 1em;
    }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.gallery-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Book Navigation */
.book-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2em 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    gap: 2em;
}

.book-nav-prev, .book-nav-next, .book-nav-home {
    font-family: 'adobe-garamond-pro', 'Georgia', serif;
    text-decoration: none;
    color: hsl(var(--black-hsl));
    transition: opacity 0.3s ease;
}

.book-nav-prev:hover, .book-nav-next:hover, .book-nav-home:hover {
    opacity: 0.6;
}

.book-nav-home {
    text-align: center;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2em;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

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

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    height: auto;
    width: auto;
    display: block;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 40px;
    height: 40px;
}

.lightbox-close:hover {
    opacity: 0.7;
}

/* Lightbox Navigation */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid hsl(var(--black-hsl));
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: hsl(var(--black-hsl));
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev:hover svg,
.lightbox-next:hover svg {
    stroke: hsl(var(--white-hsl));
}

.lightbox-prev svg,
.lightbox-next svg {
    width: 24px;
    height: 24px;
    stroke: hsl(var(--black-hsl));
    transition: stroke 0.3s ease;
}

@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-prev svg,
    .lightbox-next svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 768px) {
    .book-hero {
        grid-template-columns: 1fr;
        gap: 3em;
    }

    .book-hero-content h1 {
        font-size: 2.5em;
    }

    .book-gallery {
        grid-template-columns: 1fr;
        gap: 3em;
    }

    .book-navigation {
        flex-direction: column;
        text-align: center;
    }
}
