/* Custom CSS for Jerome M. Sattler, Publisher Website */

/* CSS Variables for Brand Colors */
:root {
    --brand-50: #e6eaf0;
    --brand-100: #ccd5e1;
    --brand-200: #99abc3;
    --brand-300: #6681a5;
    --brand-400: #335787;
    --brand-500: #012854;
    --brand-600: #012043;
    --brand-700: #011832;
    --brand-800: #001022;
    --brand-900: #000811;
}

/* Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus Styles for Accessibility */
*:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

/* Skip to Main Content Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--brand-500);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Header Styles */
header {
    transition: box-shadow 0.3s ease;
}

header.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Navigation Dropdown Animations */
.group:hover .group-hover\:visible {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.group > div {
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.group:hover > div {
    transform: translateY(0);
}

/* Mobile Menu Transitions */
#mobile-menu {
    transition: max-height 0.3s ease-out, opacity 0.2s ease;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

#mobile-menu.open {
    max-height: 500px;
    opacity: 1;
}

/* Accordion Animations */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-content.open {
    max-height: 300px;
}

.accordion-arrow {
    transition: transform 0.3s ease;
}

.accordion-arrow.rotate {
    transform: rotate(180deg);
}

/* Button Hover Effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-primary:hover::after {
    width: 300px;
    height: 300px;
}

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

article.group:hover {
    transform: translateY(-4px);
}

/* Prose Styles for Content */
.prose h2 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.875rem; /* text-3xl */
    font-weight: 700;
    color: #111827; /* text-gray-900 */
    margin-top: 2em;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .prose h2 {
        font-size: 2.25rem; /* sm:text-4xl */
    }
}

.prose h3 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.5rem; /* text-2xl */
    font-weight: 700;
    color: #1f2937; /* text-gray-800 */
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.prose a {
    color: var(--brand-500);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose a:hover {
    color: var(--brand-600);
}

.prose ul {
    list-style-type: disc;
    padding-left: 1.5em;
}

.prose ol {
    list-style-type: decimal;
    padding-left: 1.5em;
}

.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* Blockquote Styles */
blockquote {
    position: relative;
}

blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 4rem;
    color: var(--brand-200);
    font-family: Georgia, serif;
    line-height: 1;
    opacity: 0.5;
}

/* Form Styles */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    ring: 2px;
    ring-color: var(--brand-500);
    border-color: var(--brand-500);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background-color: var(--brand-50);
    font-weight: 600;
    color: var(--brand-700);
}

tr:hover {
    background-color: #f9fafb;
}

/* Scroll Indicator for Sticky Nav */
.sticky-nav-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background-color: var(--brand-500);
    transition: width 0.3s ease;
}

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--brand-100);
    border-top-color: var(--brand-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .prose {
        font-size: 0.95rem;
    }

    blockquote::before {
        font-size: 3rem;
    }
}

/* Print Styles */
@media print {
    header,
    footer,
    nav,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* Utility Classes */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* PayPal Button Wrapper */
.paypal-button-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 1.5rem auto;
    display: flex;
    justify-content: center;
}

/* PayPal Add to Cart Button */
paypal-add-to-cart-button {
    width: 100%;
}


.publication-single-section .book-details__author_label {
    max-width: 150px;
    text-align: right;
}
