/* Custom Styles for iwriteyouread.org */

/* Font Configuration */
body {
    font-family: 'Lato', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.font-serif,
h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', 'Playfair Display', Georgia, 'Times New Roman', serif;
}

/* Background Logo Watermark */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    max-width: 800px;
    height: 60vw;
    max-height: 800px;
    background-image: url('/assets/logoo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.07;
    z-index: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    body::before {
        width: 80vw;
        height: 80vw;
        max-width: 500px;
        max-height: 500px;
    }
}

/* Ensure all content is above the watermark */
body > * {
    position: relative;
    z-index: 1;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Animation Utilities */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Navbar Styles */
#navbar {
    transition: all 0.3s ease;
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background-color: #1e3a8a;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile Menu Transitions */
#mobile-menu {
    transition: max-height 0.3s ease-in-out;
}

/* Button Hover Effects */
.btn-primary,
.btn-secondary,
.btn-tertiary {
    transition: all 0.2s ease;
}

/* Card Hover Effects */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Blog Post Styles */
.blog-post {
    transition: all 0.3s ease;
}

.blog-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.blog-post img {
    transition: transform 0.3s ease;
}

.blog-post:hover img {
    transform: scale(1.05);
}

/* Tag Filter Styles */
.tag-filter {
    transition: all 0.2s ease;
    cursor: pointer;
}

.tag-filter.active {
    background-color: #92400e;
    color: white;
    border-color: #92400e;
}

/* Prose Styles for Blog Content */
.prose {
    max-width: 65ch;
}

.prose p {
    margin-bottom: 1.25em;
    line-height: 1.75;
}

.prose h2 {
    margin-top: 2em;
    margin-bottom: 1em;
    font-size: 1.5em;
    font-weight: 700;
}

.prose h3 {
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    font-size: 1.25em;
    font-weight: 600;
}

.prose a {
    color: #1e3a8a;
    text-decoration: underline;
}

.prose a:hover {
    color: #1e40af;
}

/* Newsletter Modal Styles */
#newsletter-modal {
    backdrop-filter: blur(4px);
}

#newsletter-modal > div {
    max-height: 90vh;
    overflow-y: auto;
}

/* Form Styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #1e3a8a;
    ring: 2px;
    ring-color: rgba(30, 58, 138, 0.2);
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
}

/* Site Logo Styles */
.site-logo {
    max-width: 100px; /* Maximum width of 100px */
    width: 3rem; /* 48px for desktop */
    height: 3rem; /* 48px for desktop */
    border-radius: 50%; /* Circular shape */
    object-fit: cover;
    object-position: center;
    display: block;
    flex-shrink: 0; /* Prevent logo from shrinking */
    margin-right: 10px; /* 10px spacing between logo and title */
}

/* Author Logo in Header */
.author-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin-right: 10px;
}

/* Responsive logo sizing */
@media (max-width: 640px) {
    .site-logo {
        width: 2.5rem; /* 40px for mobile */
        height: 2.5rem; /* 40px for mobile */
    }
    
    .author-logo {
        width: 60px; /* Smaller on mobile */
        height: 60px; /* Smaller on mobile */
    }
}

/* Gradient Backgrounds */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Book Cover Shadow */
.book-shadow {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Gumroad Button Override */
.gumroad-button {
    display: inline-block;
    text-decoration: none !important;
}

/* Footer Links */
footer a {
    transition: color 0.2s ease;
}

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

/* Focus Visible */
*:focus-visible {
    outline: 2px solid #1e3a8a;
    outline-offset: 2px;
}

/* Buy Me Coffee Button - Brown Theme */
.coffee-button {
    background-color: #6f4e37;
    color: white;
    border-radius: 30px;
    padding: 10px 18px;
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: Georgia, serif;
    box-shadow: 0 2px 8px rgba(111, 78, 55, 0.3);
    transition: all 0.3s ease;
    z-index: 40;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    display: inline-block;
}

.coffee-button:hover {
    background-color: #5a3d2c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(111, 78, 55, 0.4);
}

/* Print Styles */
@media print {
    nav,
    footer,
    #newsletter-modal {
        display: none;
    }
    
    body {
        background: white;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    /* Keep light mode for now as per requirements */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Selection */
::selection {
    background-color: #92400e;
    color: white;
}

::-moz-selection {
    background-color: #92400e;
    color: white;
}

/* Excerpt Toggle Animation */
#excerpt-content {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

#excerpt-icon {
    transition: transform 0.3s ease;
}

#excerpt-icon.rotate {
    transform: rotate(180deg);
}

/* Prose Photo Styling */
.prose-photo {
    width: 80%;
    max-width: 500px;
    border-radius: 12px;
    margin: 20px auto;
    display: block;
}

/* Poem Section Styling */
.poem-section {
    text-align: center;
}

.poem-text {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    line-height: 2.2;
    color: #374151;
    font-style: italic;
}

@media (max-width: 768px) {
    .poem-text {
        font-size: 1.25rem;
        line-height: 2;
    }
}

@media (max-width: 640px) {
    .poem-text {
        font-size: 1.125rem;
        line-height: 1.8;
    }
}

/* Image with rounded corners and shadows */
.elegant-image {
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.elegant-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Feather icon styling */
.feather-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    margin-left: 0.3em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.feather-icon:hover {
    transform: translateY(-2px) rotate(5deg);
}
