/* Common styles for all author pages */
html, body { 
    height: 100%; 
    padding: 0; 
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    color: #00020E;
    background-color: #f9f9f9;
    scroll-behavior: smooth;
    line-height: 1.6;
}

.navbar {
  display: flex; 
  justify-content: left; 
  align-items: center; 
  width: 100%; 
  padding: 20px 0;
  background-color: #080f5b;
  border-bottom: 6px solid;
  border-image-source: linear-gradient(145deg, #bdbdbd, #f2f2f2, #fbfbfb, #ffffff, #bababa);
  border-image-slice: 1;
}

/* Individual Book Page Styles (De Officiis, etc.) */
.book-page-layout {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    background-color: #F4F3F0;
}

.book-page-layout .navbar {
    background-color: #F4F3F0;
    border-bottom: none;
}

.book-display {
    width: 100%;
    height: 500px;
    margin: 0 auto 40px auto;
    position: relative;
    background-color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.02);
}

.book-cover-main {
    max-height: 450px;
    max-width: 320px;
    width: auto;
    height: auto;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.book-cover-main:hover {
    transform: scale(1.05);
}

.author-info {
    text-align: center;
    margin: 40px 0;
}

.author-name {
    font-size: 28px;
    color: #000000;
    font-weight: 700;
    margin-bottom: 10px;
}

.book-title {
    font-size: 36px;
    color: #000000;
    font-weight: 300;
    margin-bottom: 20px;
    font-style: italic;
}

.purchase-section {
    text-align: center;
    margin: 40px auto;
    max-width: 900px;
    padding: 30px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.02);
}

.purchase-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 500;
}

.amazon-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
}

.main-button {
    grid-column: 1 / -1;
}

.purchase-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #0a1166, #080f5b);
    color: #ffffff !important;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(8,15,91,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
    box-sizing: border-box;
    text-decoration: none;
}

.purchase-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        35deg,
        transparent 0%,
        rgba(192, 192, 192, 0) 30%,
        rgba(220, 220, 220, 0.1) 40%,
        rgba(255, 255, 255, 0.2) 45%,
        rgba(240, 240, 240, 0.3) 50%,
        rgba(255, 255, 255, 0.2) 55%,
        rgba(220, 220, 220, 0.1) 60%,
        rgba(192, 192, 192, 0) 70%,
        transparent 100%
    );
    animation: shine-loop 6s infinite linear;
    pointer-events: none;
    z-index: 1;
}

@keyframes shine-loop {
    0% {
        transform: translate(-100%, 100%);
    }
    100% {
        transform: translate(100%, -100%);
    }
}

.purchase-button:hover {
    background: linear-gradient(145deg, #0c1470, #0a1166);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(8,15,91,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

.purchase-button:visited {
    color: #ffffff !important;
}

.purchase-button span {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
}

.find-books-button {
    display: block;
    background: #080f5b;
    color: white !important;
    padding: 16px 40px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin: 30px auto 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.1);
    max-width: 300px;
    text-decoration: none;
}

.find-books-button:hover {
    background: #0a1166;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(8,15,91,0.3);
}

.find-books-button:visited {
    color: white !important;
}

.intro-text {
    font-size: 16px;
    color: #333;
    line-height: 1.7;
    margin-bottom: 30px;
}

/* Book page specific overrides */
.book-page-layout .content-area {
    width: 100%;
}

.book-page-layout .books-section {
    margin-bottom: 60px;
    scroll-margin-top: 20px;
}

.book-page-layout .section-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.book-page-layout .section-title {
    font-size: 24px;
    font-weight: 600;
    color: #000000;
    text-align: center;
}

.book-page-layout .content-block {
    background-color: #fff;
    border-radius: 4px;
    padding: 30px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.02);
    margin-bottom: 30px;
}

.book-page-layout .content-block h2 {
    color: #000000;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 600;
}

.book-page-layout .content-block h3 {
    color: #000000;
    font-size: 18px;
    margin-top: 30px;
    margin-bottom: 15px;
    font-style: italic;
}

.book-page-layout .content-block p {
    margin-bottom: 20px;
    font-size: 15px;
    color: #333;
}

.book-page-layout .content-block ul {
    position: relative;
    z-index: 2;
}

.book-page-layout a {
    color: #080f5b;
    text-decoration: none;
    font-weight: bold;
}

.book-page-layout a:visited {
    color: #080f5b;
}

/* FIXED: Override visited state for buttons specifically */
.book-page-layout .purchase-button:visited,
.book-page-layout .find-books-button:visited {
    color: #ffffff !important;
}

/* Book page responsive styles */
@media (max-width: 992px) {
    .amazon-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .main-button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .book-display {
        height: 450px;
    }
    
    .book-cover-main {
        max-height: 400px;
        max-width: 280px;
    }
    
    .book-title {
        font-size: 32px;
    }
    
    .author-name {
        font-size: 24px;
    }
    
    .purchase-section {
        padding: 20px 15px;
    }
    
    .amazon-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .main-button {
        grid-column: 1 / -1;
    }
    
    .purchase-button {
        padding: 14px 16px;
        font-size: 14px;
        width: 100%;
        white-space: normal;
    }
}

@media (max-width: 576px) {
    .book-page-layout .navbar img {
        width: 150px;
    }
    
    .book-display {
        height: 400px;
    }
    
    .book-cover-main {
        max-height: 350px;
        max-width: 240px;
    }
    
    .book-title {
        font-size: 28px;
    }
    
    .author-name {
        font-size: 20px;
    }
    
    .purchase-section {
        padding: 20px 10px;
    }
    
    .amazon-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0;
    }
    
    .purchase-button {
        padding: 14px 10px;
        font-size: 13px;
        white-space: normal;
    }
    
    .find-books-button {
        padding: 14px 30px;
        font-size: 15px;
        margin: 20px auto 0;
    }
}

.page-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.side-navigation {
    width: 250px;
    min-width: 250px;
    padding-right: 30px;
    position: sticky;
    top: 30px;
    height: fit-content;
}

.nav-items-container {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.nav-item {
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    color: #aaaaaa;
    cursor: pointer;
    padding: 5px 0;
    transition: color 0.3s ease;
    text-align: left;
}

.nav-item.active {
    color: #080f5b;
}

.nav-item:hover {
    color: #080f5b;
}

.content-area {
    flex: 1;
}

/* Generic author section - can be used for any author */
.author-section {
    margin-bottom: 60px;
    scroll-margin-top: 20px;
}

.books-section {
    margin-bottom: 60px;
    scroll-margin-top: 20px;
}

.section-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #080f5b;
}

.content-block {
    background-color: #fff;
    border-radius: 4px;
    padding: 30px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.02);
    margin-bottom: 30px;
}

/* Special content block for publications - no background */
.content-block.publications-container {
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    margin-bottom: 40px;
}

.content-block h2 {
    color: #080f5b;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 600;
}

.content-block h3 {
    color: #080f5b;
    font-size: 18px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.content-block p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #333;
    line-height: 1.7;
}

/* Hero intro section styles */
.hero-intro {
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #f8f9fc 0%, #e8f0fe 100%);
    border-radius: 12px;
    padding: 50px 30px;
    box-shadow: 0 4px 20px rgba(8, 15, 91, 0.05);
}

.hero-title {
    font-size: 36px;
    font-weight: 700;
    color: #080f5b;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 18px;
    color: #555;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 30px;
    max-width: 600px;
    margin: 0 auto;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #080f5b;
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Biography Section */
.biography-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 40px;
}

.portrait-section {
    background-color: #090f5b;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(9, 15, 91, 0.2);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.portrait-section h2 {
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.portrait-image {
    width: 100%;
    max-width: 240px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto 25px;
    display: block;
    position: relative;
    z-index: 2;
}

.portrait-description {
    color: #e8eaf7;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
    position: relative;
    z-index: 2;
}

.portrait-caption {
    color: #c5cae9;
    font-size: 14px;
    font-style: italic;
    position: relative;
    z-index: 2;
}

.biography-content {
    background-color: #fff;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.biography-content h2 {
    color: #080f5b;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: 600;
}

/* ==============================================
   MAIN BOOKS PAGE - NEW CARD LAYOUT (4 columns desktop, 2 mobile)
   ============================================== */

/* NEW LAYOUT: Publications Grid for main books page - FIXED FOR FULL WIDTH */
.publications-container .publications-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 40px;
    padding: 0;
    /* Ensure grid takes full width */
    width: 100%;
    box-sizing: border-box;
}

/* NEW LAYOUT: Card-style book items for main books page */
.publications-container .booktitle {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
    /* Ensure cards take full width within grid */
    width: 100%;
    box-sizing: border-box;
}

.publications-container .booktitle:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    border: 1px solid rgba(8, 15, 91, 0.1);
}

/* FIXED: Book Cover Container for main books page - Images extend to edges with no padding */
.publications-container .book-cover-container {
    position: relative;
    width: 100%;
    padding-bottom: 140%; /* 1:1.4 aspect ratio for book covers */
    background: #f8f9fa;
    overflow: hidden;
    /* REMOVED border-radius to allow images to extend to top edges */
    border-radius: 0;
    margin: 0; /* Remove any margin */
    padding-left: 0; /* Remove left padding */
    padding-right: 0; /* Remove right padding */
}

.publications-container .book-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* CHANGED: Use cover to fill entire container and extend to edges */
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    /* Remove background since we want edge-to-edge coverage */
    border-radius: 12px 12px 0 0; /* Only round top corners to match card */
}

.publications-container .booktitle:hover .book-cover {
    transform: scale(1.02);
}

/* NEW LAYOUT: No Image State for main books page */
.publications-container .booktitle.no-image .book-cover-container {
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-weight: 500;
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    line-height: 1.3;
    border-radius: 12px 12px 0 0; /* Match the card styling */
}

/* FIXED: Book Content for main books page with improved button spacing */
.publications-container .book-content {
    padding: 18px 16px 20px 16px; /* Increased padding for better button spacing */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

.publications-container .book-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a202c;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6rem;
}

.publications-container .book-content h3 a {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}

.publications-container .book-content h3 a:hover {
    color: #080f5b;
}

.publications-container .book-content h3 a:visited {
    color: inherit;
}

.publications-container .book-author {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 auto 0;
    font-weight: 500;
    line-height: 1.3;
    flex-grow: 1;
    display: flex;
    align-items: center;
    min-height: 2.5rem;
}

/* FIXED: Book Actions with proper button spacing and padding */
.publications-container .book-actions {
    margin-top: 14px; /* Increased margin for better spacing */
    width: 100%;
    padding-top: 2px; /* Small padding to separate from author text */
}

.publications-container .btn {
    display: inline-block;
    padding: 12px 18px; /* Increased padding for better button size */
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    letter-spacing: 0.025em;
    color: white !important;
    box-sizing: border-box; /* Ensure padding doesn't break layout */
}

.publications-container .btn-primary {
    background: #080f5b;
    color: white !important;
    box-shadow: 0 2px 8px rgba(8, 15, 91, 0.25);
}

.publications-container .btn-primary:hover {
    background: #0a1266;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 15, 91, 0.35);
}

.publications-container .btn-primary:visited {
    color: white !important;
}

.publications-container .btn-secondary {
    background: #64748b;
    color: white !important;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.2);
}

.publications-container .btn-secondary:visited {
    color: white !important;
}

.publications-container .btn-secondary:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.publications-container .booktitle.sold-out {
    opacity: 0.75;
}

.publications-container .booktitle.sold-out:hover {
    transform: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* ==============================================
   AUTHOR PAGES - ORIGINAL HORIZONTAL LAYOUT
   ============================================== */

/* ORIGINAL LAYOUT: Publications Grid for author pages */
.publications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 35px;
    margin-top: 30px;
}

/* ORIGINAL LAYOUT: Horizontal book items for author pages */
.booktitle {
    background-color: #fff;
    border: 1px solid #e8e9f0;
    border-radius: 12px;
    padding: 25px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: flex;
    align-items: flex-start;
    gap: 25px;
    min-height: 220px;
    width: 100%;
}

.booktitle:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(8, 15, 91, 0.15);
    border-color: #080f5b;
}

/* ORIGINAL LAYOUT: Direct book cover for author pages */
.book-cover {
    width: 150px;
    height: 200px;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    display: block;
    background-color: #f5f5f5;
}

.booktitle:hover .book-cover {
    transform: scale(1.02);
}

.book-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 180px;
}

.book-content.no-image {
    text-align: left;
    max-width: 100%;
    min-height: auto;
}

.booktitle a {
    font-size: 20px;
    font-weight: 600;
    color: #080f5b;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    transition: color 0.3s;
    line-height: 1.3;
}

.booktitle a:hover {
    color: #3a4080;
}

.book-edition {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    background-color: #f0f2f8;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.book-description {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.book-author {
    font-size: 14px;
    color: #777;
    margin-bottom: 8px;
    font-weight: 500;
}

.book-badges {
    margin-bottom: 8px;
}

.badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
}

.badge-new {
    background-color: #e8f5e8;
    color: #2e7d2e;
}

.badge-available {
    background-color: #e8f4f8;
    color: #2c5aa0;
}

.badge-sold-out {
    background-color: #f8e8e8;
    color: #a02c2c;
}

.book-actions {
    margin-top: auto;
    padding-top: 10px;
}

.btn {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: #080f5b;
    color: white !important;
    border-color: #080f5b;
}

.btn-primary:hover {
    background-color: #0a1165;
    border-color: #0a1165;
    transform: translateY(-1px);
}

.btn-primary:visited {
    color: white !important;
}

.btn-secondary {
    background-color: #64748b;
    color: white !important;
    border-color: #64748b;
}

.btn-secondary:visited {
    color: white !important;
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.booktitle.sold-out {
    opacity: 0.7;
    background-color: #fafafa;
}

.booktitle.sold-out:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* For books without images - ensure consistent layout */
.booktitle.no-image {
    justify-content: center;
    min-height: 180px;
    padding: 30px;
}

/* Links */
a {
    color: #080f5b;
    text-decoration: none;
    font-weight: bold;
}

a:visited {
    color: #080f5b;
}

.highlight {
    color: #080f5b;
    font-weight: 600;
}

/* Quote blocks */
.quote-block {
    background-color: #f8f9fc;
    border-left: 3px solid #080f5b;
    padding: 20px;
    margin: 25px 0;
    font-style: italic;
    color: #444;
}

.quote-number {
    font-weight: 600;
    color: #080f5b;
    margin-bottom: 8px;
    font-style: normal;
}

.quote-text {
    font-size: 16px;
    line-height: 1.6;
}

.quote-block-large {
    background-color: #f0f2f8;
    border-radius: 4px;
    padding: 25px;
    margin: 30px 0;
    position: relative;
}

.quote-block-large::before {
    content: '"';
    font-size: 60px;
    font-family: Georgia, serif;
    color: #080f5b;
    opacity: 0.2;
    position: absolute;
    top: 10px;
    left: 15px;
}

.quote-text-large {
    font-style: italic;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 15px;
    padding-left: 30px;
}

.quote-author {
    text-align: right;
    font-weight: 600;
    color: #080f5b;
}

/* Styles section */
.styles-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 40px;
    margin-top: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.styles-section h2 {
    color: #080f5b;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 600;
}

.styles-section p {
    font-size: 16px;
    line-height: 1.7;
    color: #444;
    margin-bottom: 20px;
}

/* Video content */
.content-video {
    margin: 40px auto;
    height: 400px;
    text-align: center;
    width: 90%;
    max-width: 440px;
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Timeline - Enhanced for better author page integration */
.relevance-section {
    margin-top: 40px;
}

.timeline {
    margin: 40px 0;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: calc(100% - 40px);
    width: 2px;
    background-color: #e0e0e0;
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 40px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-year {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    background-color: #080f5b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
    z-index: 2;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.timeline-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 20px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 8px 0;
    border-color: transparent #ffffff transparent transparent;
}

.timeline-title {
    font-weight: 600;
    color: #080f5b;
    margin-bottom: 12px;
    font-size: 18px;
}

.timeline-text {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.timeline-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    font-style: italic;
}

/* Timeline book cover - FIXED sizing for consistency */
.timeline-book-cover {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    float: right;
    margin-left: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* FIXED: Enhanced Footer - Use light footer style for ALL pages */
footer {
    width: 100%;
    padding: 50px 0;
    margin-top: 60px;
    background-color: #fafafa;
    border-top: 1px solid #eeeeee;
    box-sizing: border-box;
}

footer * {
    box-sizing: border-box;
}

.footer-content {
    display: flex;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.footer-left {
    display: flex;
    gap: 80px;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-nav a {
    color: #666;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: #080f5b;
}

.footer-nav a:visited {
    color: #666;
}

.footer-form {
    display: flex;
    align-items: flex-start;
}

.footer-privacy {
    margin-top: auto;
}

.footer-text {
    font-family: Georgia, serif;
    font-size: 13px;
    color: #aaa;
    line-height: 1.5;
    margin-bottom: 20px;
}

.footer-badges {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-badges img {
    height: 45px;
    opacity: 0.65;
}

.tally-iframe-container {
    width: 350px;
    max-width: 100%;
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
}

.tally-iframe-container iframe {
    width: 100% !important;
    max-width: 100% !important;
}

.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* ==============================================
   RESPONSIVE BREAKPOINTS - UPDATED FOR FULL WIDTH
   ============================================== */

/* NEW LAYOUT RESPONSIVE - Main books page only - FIXED FOR EDGE-TO-EDGE */
@media (max-width: 1400px) {
    .publications-container .publications-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

@media (max-width: 1200px) {
    .publications-container .publications-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (max-width: 900px) {
    .publications-container .publications-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        /* Ensure mobile layout sticks to edges */
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Reduce padding on container for mobile to maximize card width */
    .page-layout {
        padding: 40px 15px;
    }
}

@media (max-width: 600px) {
    .publications-container .publications-grid {
        gap: 8px;
    }
    
    .publications-container .book-content {
        padding: 16px 14px 18px 14px; /* Adjusted for mobile */
        min-height: 110px;
    }
    
    .publications-container .book-content h3 {
        font-size: 0.95rem;
        min-height: 2.4rem;
    }
    
    .publications-container .book-author {
        font-size: 0.8rem;
        min-height: 2.2rem;
    }

    .publications-container .btn {
        padding: 10px 16px; /* Proper mobile button padding */
        font-size: 0.78rem;
    }
    
    /* Further reduce padding on mobile for more edge-to-edge effect */
    .page-layout {
        padding: 40px 10px;
    }
}

@media (max-width: 480px) {
    .publications-container .publications-grid {
        gap: 6px;
        /* Maximum edge-to-edge on smallest screens */
        margin-left: -5px;
        margin-right: -5px;
        width: calc(100% + 10px);
    }
    
    .publications-container .book-content {
        padding: 14px 12px 16px 12px; /* Consistent mobile padding */
        min-height: 100px;
    }
    
    .publications-container .book-content h3 {
        font-size: 0.9rem;
        min-height: 2.2rem;
    }
    
    .publications-container .book-author {
        font-size: 0.75rem;
        min-height: 2rem;
    }

    .publications-container .btn {
        padding: 9px 14px; /* Slightly smaller mobile buttons */
        font-size: 0.74rem;
    }
    
    /* Minimal padding for true edge-to-edge */
    .page-layout {
        padding: 40px 5px;
    }
}

/* ORIGINAL LAYOUT RESPONSIVE - Author pages only */
@media (max-width: 1200px) {
    .biography-container {
        grid-template-columns: 280px 1fr;
        gap: 30px;
    }
    
    .publications-grid {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
        gap: 30px;
    }
    
    .book-cover {
        width: 140px;
        height: 185px;
    }
}

@media (max-width: 992px) {
    .side-navigation {
        width: 200px;
        min-width: 200px;
    }
    
    .nav-item {
        font-size: 15px;
    }
    
    .biography-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .portrait-section {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .portrait-image {
        max-width: 200px;
    }
    
    .publications-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .book-cover {
        width: 130px;
        height: 175px;
    }
    
    .hero-title {
        font-size: 30px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-left {
        flex-direction: column;
        gap: 30px;
    }
    
    .footer-column {
        width: 100%;
        gap: 30px;
    }
    
    .footer-form {
        width: 100%;
    }
    
    .tally-iframe-container {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .page-layout {
        flex-direction: column;
    }
    
    .side-navigation {
        width: 100%;
        min-width: 100%;
        padding-right: 0;
        margin-bottom: 25px;
        position: sticky;
        top: 0;
        background-color: #f9f9f9;
        padding: 12px 0;
        z-index: 100;
        border-bottom: 1px solid #eee;
    }
    
    .nav-items-container {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0 10px;
        justify-content: flex-start;
    }
    
    .nav-item {
        display: inline-block;
        margin-right: 10px;
        margin-bottom: 10px;
        font-size: 13px;
        padding: 8px 12px;
        border-radius: 18px;
        background-color: #f1f1f1;
        white-space: nowrap;
        text-align: left;
    }
    
    .nav-item:last-child {
        margin-right: 0;
    }
    
    .nav-item.active {
        background-color: #e6e9f5;
    }
    
    .biography-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .portrait-section {
        max-width: 100%;
    }
    
    .portrait-image {
        max-width: 180px;
    }
    
    .biography-content {
        padding: 25px;
    }
    
    .biography-content h2 {
        font-size: 24px;
    }
    
    .intro-text {
        font-size: 16px;
    }
    
    .hero-title {
        font-size: 26px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .publications-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .booktitle {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        min-height: auto;
        padding: 25px;
    }
    
    .book-cover {
        width: 120px;
        height: 160px;
        margin: 0 auto;
    }
    
    .book-content {
        text-align: left;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .footer-badges img {
        height: 40px;
    }
    
    .footer-left {
        flex-direction: column;
    }
    
    .footer-column {
        display: contents;
    }
    
    .footer-nav {
        order: 1;
    }
    
    .footer-form {
        order: 2;
        margin: 20px 0;
    }
    
    .footer-privacy {
        order: 3;
        margin-top: 0;
    }
    
    .timeline-book-cover {
        width: 60px;
        height: 75px;
    }
}

@media (max-width: 576px) {
    .navbar img {
        width: 150px;
    }
    
    .author-section, .books-section {
        margin-bottom: 40px;
    }
    
    .nav-item {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .hero-title {
        font-size: 22px;
    }
    
    .hero-subtitle {
        font-size: 15px;
    }
    
    .hero-intro {
        padding: 30px 20px;
    }
    
    .portrait-image {
        max-width: 160px;
    }
    
    .biography-content {
        padding: 20px;
    }
    
    .biography-content h2 {
        font-size: 22px;
    }
    
    .intro-text {
        font-size: 15px;
    }
    
    .publications-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .book-cover {
        width: 110px;
        height: 145px;
    }
    
    .booktitle {
        min-height: auto;
        padding: 20px;
    }
    
    .booktitle a {
        font-size: 18px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .footer-badges {
        flex-wrap: wrap;
    }
    
    .footer-badges img {
        height: 35px;
    }
    
    .timeline-book-cover {
        width: 50px;
        height: 65px;
    }
}