/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: 'Georgia', serif;
    line-height: 1.6;
    color: #222222;
    background-color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main content takes up available space */
.site-content, .homepage-hero {
    flex: 1;
}

/* Header styles */
.site-header {
    background-color: #f4f4f4;
    padding: 15px 0;
    position: relative;
}

#site-banner {
    width: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

#site-banner-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.site-branding {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

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

.site-branding h1 {
    font-family: 'Georgia', serif;
    font-size: 28px;
    font-weight: bold;
    color: #222222;
    margin: 0;
}

.site-branding .tagline {
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #222222;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* Navigation styles */
.main-navigation {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: #222222;
    text-decoration: none;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: normal;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #565656;
}

.sub-menu {
    display: none;
    position: absolute;
    background-color: #f4f4f4;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    list-style: none;
    padding: 10px 0;
    margin-top: 0;
    top: 100%;
    left: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    border-radius: 4px;
}

.menu-item-has-children {
    position: relative;
}

.menu-item-has-children:hover .sub-menu,
.sub-menu:hover {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Add a small delay before hiding submenu */
.menu-item-has-children .sub-menu {
    transition-delay: 0s;
}

.menu-item-has-children:hover .sub-menu {
    transition-delay: 0.1s;
}

.sub-menu:hover {
    transition-delay: 0s;
}

/* Add invisible area to prevent submenu from disappearing */
.menu-item-has-children::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 10px;
    background: transparent;
}

.menu-item-has-children:hover::after {
    height: 20px;
}

.sub-menu a {
    color: #222222;
    padding: 12px 20px;
    display: block;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sub-menu a:hover {
    background-color: rgba(0,0,0,0.1);
    color: #565656;
}

/* Search form styles */
.search-wrapper {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.search-form {
    display: flex;
    align-items: center;
}

.search-field {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 5px;
    width: 200px;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.search-submit {
    padding: 8px 16px;
    background-color: #222222;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.search-submit:hover {
    background-color: #565656;
}

/* Homepage specific styles */
.homepage-hero {
    position: relative;
    min-height: 80vh;
    background-image: url('../images/index-hero.jpg');
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.hero-content {
    max-width: 1400px;
    margin: 0;
    padding: 60px 40px 60px 80px;
    color: white;
    width: 100%;
}

.hero-logo {
    margin-bottom: 20px;
    display: block;
}

.hero-logo img {
    max-width: 231px;
    height: auto;
    display: block;
    width: 231px;
}

.hero-title {
    font-family: 'Georgia', serif;
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-text {
    font-family: 'Georgia', serif;
    font-size: 18px;
    line-height: 1.8;
    max-width: 600px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.hero-text p {
    color: white;
    font-weight: bold;
}

/* Content styles */
.site-content {
    min-height: 60vh;
}

.entry-content {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.fl-rich-text {
    text-align: center;
    margin: 40px 0;
}

.fl-rich-text img {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

/* Override for author image specifically */
.fl-rich-text img.wp-image-115 {
    max-width: 240px !important;
    width: 240px !important;
    height: auto !important;
    float: right !important;
    margin: 0 0 25px 25px !important;
    clear: right !important;
    padding: 10px !important;
    background-color: #ffffff !important;
    border-radius: 5px !important;
}

/* Book cover image styles */
.alignright {
    float: right;
    margin: 0 0 20px 20px;
}

.wp-image-151 {
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Books page specific styles */
.fl-rich-text p {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 20px;
    text-align: justify;
}

/* Add padding below content on desktop */
.entry-content {
    padding-bottom: 80px;
}

.fl-rich-text p strong {
    font-weight: 700;
}

.fl-rich-text p em {
    font-style: italic;
}

.fl-rich-text a {
    color: #0066cc;
    text-decoration: underline;
}

.fl-rich-text a:hover {
    color: #004499;
}

/* Ensure proper text wrapping around floating image */
.fl-rich-text {
    overflow: hidden;
}

.alignright {
    float: right;
    margin: 0 0 20px 20px;
    clear: right;
}

/* About the Author page specific styles */
.fl-rich-text p:first-child {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 30px;
}

.fl-rich-text p:first-child span {
    font-size: 20px;
    font-weight: bold;
}

/* Override for poems page - make first paragraph same as others */
.poems-hero + .entry-content .fl-rich-text p:first-child {
    text-align: left;
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 30px;
}

/* Override for short stories page - make first paragraph same as others */
.short-stories-hero + .entry-content .fl-rich-text p:first-child {
    text-align: justify;
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 30px;
}

/* Override for story content - make first paragraph same as others */
.story-content p:first-child {
    text-align: justify;
    font-size: 18px;
    font-weight: normal;
    margin-bottom: 20px;
}

/* Align the date to the right */
.story-content p:last-child {
    text-align: right;
}

/* Short stories hero section - increase height specifically for this page */
.short-stories-hero {
    min-height: 700px !important;
    background-position: center 30% !important;
}

/* Move the hero content to the right on short stories page */
.short-stories-hero .hero-content {
    margin-left: auto !important;
    margin-right: 50px !important;
}

/* Improve text wrapping around author image */
.wp-image-115 {
    border: none !important;
    box-shadow: none !important;
    margin: 0 0 20px 20px !important;
    width: 120px !important;
    height: auto !important;
    float: right !important;
    clear: right !important;
    max-width: 120px !important;
}

/* Add more spacing between paragraphs for better readability */
.fl-rich-text p {
    margin-bottom: 25px;
}

/* Page titles */
.entry-title {
    font-family: 'Georgia', serif;
    font-size: 36px;
    font-weight: bold;
    color: #222222;
    text-align: center;
    margin-bottom: 40px;
}

/* Footer styles */
.site-footer {
    background-color: #f4f4f4;
    padding: 15px 0;
    width: 100%;
    margin-top: auto;
}

/* Add bottom padding to body to prevent content from being hidden behind fixed footer */


#footer-banner {
    width: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    color: #333333;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.footer-right {
    display: flex;
    align-items: center;
}

.scroll-to-top {
    width: 20px;
    height: 20px;
    background-color: #cccccc;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
}

.scroll-to-top:hover {
    background-color: #999999;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #site-banner {
        flex-direction: column;
        gap: 20px;
    }
    
    #site-banner-left {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-wrapper {
        justify-content: center;
    }
    
    .homepage-hero {
        height: 50vh;
        align-items: flex-start;
        justify-content: flex-start;
        flex-direction: column;
        position: relative;
        overflow: hidden;
    }
    
    .hero-content {
        position: absolute;
        top: 20px;
        left: 20px;
        padding: 0;
        color: white;
        background: none;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        max-width: 200px;
    }
    
    .hero-logo {
        margin-bottom: 0;
    }
    
    .hero-logo img {
        max-width: 180px;
    }
    
    .hero-title {
        font-size: 32px;
        color: white;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    }
    
    .hero-text {
        display: none;
    }
    
    .hero-text p {
        display: none;
    }
    
    .mobile-hero-text {
        display: block !important;
        padding: 40px 20px;
        background-color: white;
        color: #222222;
        font-family: 'Georgia', serif;
        font-size: 16px;
        line-height: 1.8;
        text-align: left;
        margin: 0;
        width: 100%;
        position: relative;
        z-index: 100;
        box-sizing: border-box;
    }
    
    .mobile-hero-text p {
        color: #222222;
        margin: 0;
        max-width: 100%;
    }
    
    #footer-banner {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100000;
}

.skip-link:focus {
    top: 6px;
}

/* Screen reader text */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Contact page specific styles */
.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.contact-title {
    font-family: 'Georgia', serif;
    font-size: 28px;
    font-weight: 400;
    color: #222222;
    margin-bottom: 30px;
    text-align: center;
}

/* Hide mobile text on desktop */
.contact-container > .contact-intro-text {
    display: none;
}

.contact-intro-text {
    font-family: 'Georgia', serif;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
    text-align: center;
}

.contact-columns {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.contact-form-section {
    flex: 1;
    max-width: 500px;
}

.contact-image-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.contact-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Image optimization and lazy loading styles */
.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lazy.loaded {
    opacity: 1;
}

/* Image compression and optimization */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Responsive image support */
img[srcset] {
    width: 100%;
    height: auto;
}

/* Progressive image loading */
.progressive-image {
    position: relative;
    overflow: hidden;
}

.progressive-image img {
    transition: filter 0.3s ease-in-out;
}

.progressive-image img.loading {
    filter: blur(10px);
}

.progressive-image img.loaded {
    filter: blur(0);
}

.contact-title {
    font-family: 'Georgia', serif;
    font-size: 28px;
    font-weight: 400;
    color: #222222;
    margin-bottom: 30px;
    text-align: center;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-family: 'Georgia', serif;
    font-weight: 400;
    color: #222222;
    font-size: 16px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Georgia', serif;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #222222;
}

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

.submit-btn {
    background-color: #222222;
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 400;
    font-family: 'Georgia', serif;
    transition: background-color 0.3s ease;
    width: 100%;
}

.submit-btn:hover {
    background-color: #565656;
}

.submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Georgia', serif;
    text-align: center;
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.loading {
    display: none;
    text-align: center;
    margin-top: 10px;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #222222;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Contact page responsive design */
@media (max-width: 768px) {
    .contact-container {
        padding: 0;
        max-width: 100%;
    }
    
    .contact-columns {
        flex-direction: column;
        gap: 30px;
        padding: 0 20px;
    }
    
    .contact-form-section,
    .contact-image-section {
        max-width: 100%;
        width: 100%;
    }
    
    .contact-form-section {
        padding: 0;
    }
    
    .contact-image-section {
        order: -1;
        margin-bottom: 30px;
    }
    
    /* On mobile, hide the text from image section */
    .contact-image-section .contact-intro-text {
        display: none;
    }
    
    /* On mobile, show the title and text at the top */
    .contact-container > .contact-title {
        display: block;
        text-align: center;
        margin-bottom: 20px;
        padding: 0 20px;
    }
    
    .contact-container > .contact-intro-text {
        display: block;
        text-align: center;
        margin-bottom: 30px;
        padding: 0 20px;
    }
} 

/* Mobile hero text block */
.mobile-hero-text {
    display: none;
    padding: 40px 20px;
    background-color: white;
    color: #222222;
    font-family: 'Georgia', serif;
    font-size: 16px;
    line-height: 1.8;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.mobile-hero-text p {
    color: #222222;
    margin: 0;
    max-width: 100%;
} 