:root {
    --bg: #0f1724;
    --card: #111827;
    --accent: #0ea5a4;
    --muted: #94a3b8;
    --glass: rgba(255, 255, 255, 0.04);
}

/* Reset & Base */
* {
    box-sizing: border-box;
}
html, body {
    height: 100%;
}
body {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif; /* Updated font stack */
    background: linear-gradient(180deg, #071023 0%, #071827 100%);
    color: #e6eef6;
    -webkit-font-smoothing: antialiased;
}

/* ===== Header, Navbar & Hamburger ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 16px 20px;
    background: linear-gradient(180deg, rgba(10,18,28,0.95), rgba(10,18,28,0.85));
    box-shadow: 0 2px 6px rgba(2,6,23,0.25);
    transition: padding 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
    will-change: transform;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* logo sizing and smooth transition for shrink */
.logo-img {
    width: 48px;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    transition: width 180ms ease;
}

/* shrink state: reduce padding & logo so offsetHeight changes and JS works */
.header.shrink {
    padding: 8px 14px; /* Reduce padding */
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.45); /* Add shadow for emphasis */
    background: rgba(10, 18, 28, 0.95); /* Slightly darker background */
}
.header.shrink .logo-img {
    width: 36px; /* Reduce logo size */
}

/* Navbar (desktop) */
.navbar {
    position: relative;
}
.navbar ul {
    list-style: none;
    display: flex;
    gap: 18px;
    margin: 0;
    padding: 0;
    align-items: center;
}
.navbar li { margin: 0; }
.navbar a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
}
.navbar a:hover { color: white; background: rgba(14,118,116,0.12); }

/* Hamburger menu toggle button */
.navbar-toggle {
    display: none; /* Hide by default */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 6px;
}

/* Hamburger menu lines */
.navbar-toggle .line {
    width: 25px;
    height: 3px;
    background-color: white; /* Ensure the lines are white */
    margin: 4px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Responsive: show hamburger and dropdown on small screens */
@media (max-width: 768px) {
    .navbar-toggle {
        display: flex; /* Show hamburger menu on smaller screens */
    }

    .navbar ul {
        display: none;
        flex-direction: column;
        width: 150%; /* Full width for the dropdown */
        margin: 0; /* Remove extra margins */
        background: var(--card);
        padding: 12px 0; /* Add padding to ensure text fits */
        border-radius: 0; /* Make it a rectangle */
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        gap: 8px; /* Add spacing between items */
        position: absolute;
        top: 100%;
        right: 0;
        z-index: 999;
        font-size: 1rem; /* Slightly larger text for readability */
    }

    .navbar ul.active {
        display: flex; /* Show navbar items when active */
    }

    .navbar a {
        padding: 12px 16px; /* Larger tappable area */
        color: white;
        text-decoration: none;
        display: block;
        border-radius: 0; /* Remove border radius for rectangle shape */
    }

    .navbar a:hover {
        background: rgba(14, 118, 116, 0.12);
        color: white;
    }
}

/* make sure main has initial top padding so content isn't hidden before JS adjusts it */
main {
    padding-top: 110px; /* fallback; JS will set exact padding on load/resize */
}

/* ===== Main ===== */
main {
    max-width: 1100px;
    margin: 28px auto;
    padding: 0 20px;
}
.card {
    background: var(--card);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(2,6,23,0.6);
    border: 1px solid rgba(255,255,255,0.02);
}

/* ===== Footer ===== */
.site-footer {
    margin-top: 48px;
    padding: 18px 0;
    background: transparent;
    color: var(--muted);
}
.site-footer .footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}
.footer-logo {
    width: 18px;   /* smaller than before (was 40px) */
    height: auto;
    opacity: 0.9;
}

.footer-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 4px;
    transition: all 0.2s ease;
}

.footer-logo-link:hover {
    opacity: 1;
    background: rgba(14, 165, 164, 0.1);
    cursor: pointer;
}

/* ===== Responsive ===== */
@media (max-width: 720px) {
    .navbar ul {
        display: none;
    }
    .brand-text {
        display: none;
    }
    .header .header-inner {
        padding: 12px;
    }
    .logo-img {
        width: 36px; /* scale down further on mobile */
    }
    .footer-logo {
        width: 22px;
    }
}

/* ===== Feature Row ===== */
.feature-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Two equal columns */
    gap: 24px; /* Space between the boxes */
    align-items: stretch; /* Ensure boxes have equal height */
    margin: 24px 0;
}

/* Boxed Sections */
.boxed-section {
    background: var(--card);
    border: 2px solid white; /* Add white border */
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.boxed-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

/* Heading Icon */
.feature-icon {
    font-size: 1.6rem;
    display: inline-block;
    vertical-align: middle;
    margin-inline-start: 12px; /* spacing (works with RTL) */
}

/* ===== Admin templates ===== */
.admin-container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
}
.admin-header,
.form-page-header,
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background: var(--card);
    border: 2px solid white;
    border-radius: 12px;
    padding: 20px;
}
.admin-header h1,
.form-page-header h1,
.admin-page-header h1 {
    margin: 0;
    color: var(--accent);
}
.header-actions,
.actions-list,
.book-actions,
.article-actions,
.form-actions,
.admin-books-grid,
.articles-management,
.admin-cards,
.saga-book-grid {
    display: flex;
    gap: 12px;
}
.header-actions,
.form-actions,
.book-actions,
.article-actions {
    align-items: center;
}
.add-btn,
.back-btn,
.edit-btn,
.delete-btn,
.card-btn,
.action-link,
.article-btn,
.book-btn,
.submit-btn,
.cancel-btn,
.logout-btn,
.admin-btn {
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.add-btn,
.card-btn,
.edit-btn,
.admin-btn,
.article-btn,
.book-btn,
.submit-btn {
    background: var(--accent);
    color: white;
}
.add-btn:hover,
.edit-btn:hover,
.card-btn:hover,
.admin-btn:hover,
.article-btn:hover,
.book-btn:hover,
.submit-btn:hover {
    background: #0b8b89;
    transform: translateY(-2px);
}
.back-btn,
.action-link,
.cancel-btn {
    background: rgba(14, 165, 164, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent);
}
.back-btn:hover,
.action-link:hover,
.cancel-btn:hover {
    background: var(--accent);
    color: white;
}
.delete-btn {
    background: #ef4444;
    color: white;
}
.delete-btn:hover,
.logout-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
}
.logout-btn {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border-radius: 6px;
    font-weight: 600;
}
.admin-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-group label {
    color: #e6eef6;
    font-weight: 600;
    font-size: 0.95rem;
}
.form-input {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(14, 165, 164, 0.3);
    border-radius: 6px;
    color: #e6eef6;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    resize: vertical;
}
.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}
.error-message,
.error-banner {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}
.image-preview {
    margin-top: 12px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(14, 165, 164, 0.25);
    max-width: 260px;
    background: rgba(255, 255, 255, 0.05);
}
.image-preview img {
    width: 100%;
    display: block;
    border-radius: 4px;
}
.file-hint {
    margin: 8px 0 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}
textarea.form-input {
    line-height: 1.5;
}
.empty-state,
.certificates-page,
.contact-methods,
.saga-section,
.admin-books-section,
.admin-book-card,
.article-card,
.book-item {
    width: 100%;
}
.empty-state {
    text-align: center;
    padding: 40px 20px;
}
.empty-state p,
.empty-state h2 {
    margin: 8px 0;
    color: var(--muted);
}
.empty-state h2 {
    margin-top: 0;
    color: var(--accent);
}
.empty-state a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.empty-state a:hover {
    text-decoration: underline;
}

/* Admin list pages */
.articles-management,
.books-management {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.article-item,
.book-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
}
.book-item {
    align-items: stretch;
}
.article-info,
.book-info {
    flex: 1;
}
.article-item h3,
.book-item h3,
.admin-book-card h3,
.admin-card h2 {
    margin: 0 0 8px 0;
    color: var(--accent);
}
.article-meta,
.book-meta {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: var(--muted);
}
.article-excerpt,
.article-card p,
.book-card-body p {
    margin: 8px 0 0 0;
    font-size: 1rem;
    color: #e6eef6;
    line-height: 1.6;
}
.article-tags,
.tag,
.pdf-link,
.actions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag {
    background: rgba(14, 165, 164, 0.2);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}
.book-actions,
.article-actions,
.admin-book-actions,
.form-actions,
.actions-list {
    display: flex;
    gap: 12px;
}

/* Admin book list */
.book-image {
    flex-shrink: 0;
    width: 120px;
    height: 160px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(14, 165, 164, 0.2);
}
.book-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.book-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 10px;
}
.pdf-link {
    font-size: 0.85rem;
    color: var(--muted);
}

/* Admin dashboard */
.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.admin-card {
    background: var(--card);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}
.admin-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}
.admin-card .card-number {
    margin: 16px 0;
    font-size: 2.5rem;
    color: var(--accent);
    font-weight: bold;
}
.admin-card .card-label {
    color: var(--muted);
    margin: 8px 0;
    font-size: 0.9rem;
}
.quick-actions {
    background: var(--card);
    border: 2px solid white;
    border-radius: 12px;
    padding: 24px;
}
.quick-actions h2 {
    margin: 0 0 16px 0;
    color: var(--accent);
}
.action-link {
    display: block;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--accent);
    text-align: center;
    font-weight: 600;
}
.action-link:hover {
    transform: translateX(5px);
}

/* Admin login */
.admin-login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 20px;
}
.admin-login-box {
    background: var(--card);
    border: 2px solid white;
    border-radius: 12px;
    padding: 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.admin-login-box h1 {
    margin: 0 0 12px 0;
    color: var(--accent);
    text-align: center;
    font-size: 1.8rem;
}
.admin-login-box .subtitle {
    text-align: center;
    color: var(--muted);
    margin-bottom: 24px;
}
.admin-login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.admin-btn {
    width: 100%;
}
.back-link {
    display: block;
    text-align: center;
    color: var(--accent);
    text-decoration: none;
    margin-top: 20px;
    font-size: 0.9rem;
}
.back-link:hover {
    color: #0b8b89;
    text-decoration: underline;
}

/* Articles page */
.articles-container {
    margin: 24px 0;
}
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.article-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.article-image-box,
.article-image {
    width: 100%;
    display: block;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: #0f1724;
}
.article-image-box {
    height: 340px;
    min-height: 340px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.article-image-versions {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}
.article-version-link {
    display: block;
    transition: transform 200ms ease, box-shadow 200ms ease;
}
.article-version-link:hover {
    transform: translateY(-5px);
}
.article-version-link:hover .article-version-box {
    box-shadow: 0 16px 38px rgba(14, 118, 116, 0.55), 0 0 0 1px rgba(14, 118, 116, 0.15);
    border-color: rgba(14, 118, 116, 0.65);
}
.article-version-box {
    border-radius: 16px;
    overflow: hidden;
    background: #0f1724;
    border: 2px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18);
    position: relative;
    aspect-ratio: 4 / 5;
    min-height: 340px;
    transition: box-shadow 200ms ease, border-color 200ms ease, transform 180ms ease;
}
.article-version-box .article-image {
    width: 100%;
    height: 100%;
    object-fit: fill;
    transition: transform 0.25s ease;
    display: block;
}
.article-version-box:hover .article-image {
    transform: scale(1.04);
}
.article-card .article-image {
    width: 100%;
    height: 100%;
}
.download-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: white;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    pointer-events: none;
}
.article-download-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}
.article-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease, background 0.2s ease;
}
.article-btn:hover {
    background: #0b8b89;
    transform: translateY(-2px);
}
.article-card h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--accent);
}
.article-date {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}
.article-content {
    margin: 12px 0 0 0;
    line-height: 1.8;
    color: #e6eef6;
}
.article-content p {
    margin: 12px 0;
}
.article-content h3 {
    margin: 16px 0 8px 0;
    color: var(--accent);
}

/* Written books page */
.saga-section {
    margin-top: 24px;
}
.saga-images-container,
.saga-book-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}
.saga-book-link {
    text-decoration: none;
}
.saga-image,
.saga-book-card,
.article-version-link,
.article-version-box {
    width: 100%;
    max-width: 240px;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.article-image-versions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}
.article-version-link {
    text-decoration: none;
}
.article-version-box img,
.saga-image img,
.saga-book-card img {
    width: 100%;
    display: block;
    object-fit: cover;
}
.article-version-box {
    min-height: 240px;
}
.saga-downloads h3 {
    margin: 16px 0 12px 0;
    color: var(--accent);
    font-size: 1rem;
    line-height: 1.5;
}
.admin-books-section {
    margin-top: 36px;
    padding: 24px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.admin-books-section h2 {
    margin-top: 0;
    color: var(--accent);
    font-size: 1.4rem;
}
.admin-books-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}
.admin-book-item {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 2px solid var(--accent) !important;
}
.admin-book-item h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--accent);
    order: -1;
}
.admin-book-card {
    padding: 0;
    background: var(--card);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}
.admin-book-cover {
    width: 100%;
    height: 260px;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}
.admin-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}
.admin-book-cover:hover img {
    transform: scale(1.03);
}
.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.95rem;
    padding: 12px;
    text-align: center;
}
.cover-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 18px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
    color: white;
    font-weight: 700;
    font-size: 1rem;
}
.book-card-body {
    padding: 18px;
}
.admin-book-card h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--accent);
}
.book-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.book-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease, background 0.2s ease;
}
.book-btn:hover {
    background: #0b8b89;
    transform: translateY(-2px);
}

/* Certificates page */
.certificates-page {
    text-align: center;
}
.certificates-page h1 {
    margin-bottom: 50px;
}
.certificate-box {
    max-width: 60%;
    margin: 16px auto;
    margin-top: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}
.certificate-box img {
    max-width: 100%;
    height: auto;
    margin-bottom: 8px;
}

/* Contact page */
.contact-methods {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: var(--card);
}
.contact-methods ul {
    list-style: none;
    padding: 0;
}
.contact-methods li {
    margin-bottom: 12px;
}
.contact-methods a {
    color: var(--accent);
    text-decoration: none;
}
.contact-methods a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 720px) {
    .admin-page-header,
    .form-page-header,
    .admin-header,
    .admin-login-box {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    .article-item,
    .book-item,
    .admin-book-card,
    .article-card,
    .saga-images-container,
    .saga-book-grid {
        flex-direction: column;
    }
    .book-image {
        width: 100%;
        height: 200px;
    }
    .book-actions,
    .form-actions {
        flex-direction: column;
    }
    .edit-btn,
    .delete-btn,
    .submit-btn,
    .card-btn,
    .action-link,
    .admin-btn {
        width: 100%;
    }
    .articles-list,
    .admin-books-grid {
        grid-template-columns: 1fr;
    }
    .article-card {
        padding: 16px;
    }
    .article-card h2 {
        font-size: 1.2rem;
    }
    .navbar ul {
        display: none;
    }
    .brand-text {
        display: none;
    }
}


/* Icon-only Button: Rectangular shape */
.icon-btn {
    position: relative;
    margin-top: 16px; /* Ensure consistent spacing from content */
    width: 100%; /* Full width to fit the box */
    height: 40px; /* Rectangular shape */
    border-radius: 8px; /* Slightly rounded corners */
    border: none;
    background: var(--accent);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(2, 6, 23, 0.2);
    transition: transform 120ms ease, background-color 120ms ease;
    font-size: 1rem; /* Adjust font size */
    text-decoration: none;
}

/* Ensure buttons in the same row are aligned */
.feature-row .boxed-section {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Align content and button */
    height: 100%; /* Ensure equal height for sections */
}

/* Hover/focus states */
.icon-btn:hover,
.icon-btn:focus {
    transform: translateY(-2px);
    background: #0b8b89;
    outline: none;
}

/* Adjust Text Spacing */
.boxed-section p {
    margin-top: 16px;
    line-height: 1.8;
    padding-right: 12px;
}

/* Ensure Headings Look Balanced */
.boxed-section h3 {
    margin: 0 0 12px 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
}

/* Ensure Hero Spacing Remains */
.hero {
    margin-bottom: 20px;
}

/* Hero Description */
.hero-description {
    background: var(--card); /* Use the card background color */
    border: 2px solid white; /* Add white border */
    border-radius: 12px; /* Rounded corners */
    padding: 20px; /* Add padding inside the box */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */
    margin-top: 16px; /* Add spacing above the box */
}

.hero-description p {
    font-weight: bold; /* Make the text bold */
    font-size: 1.1rem; /* Slightly larger font size */
    line-height: 1.6; /* Improve readability */
    color: white; /* Change text color to white */
    margin: 0; /* Remove default margin */
}

/* Athletic Achievements Section */
.athletic-achievements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* responsive grid */
    gap: 16px;
    margin-top: 24px;
}

.athletic-achievements img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.athletic-achievements img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Athletic Achievements Container */
.athletic-achievements-container {
    background: var(--card);
    border: none; /* Remove white border from the outer box */
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    margin-top: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Athletic Achievements Grid: two fixed boxes per row, centered */
.athletic-achievements {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* two equal columns */
    justify-content: center;
    gap: 16px;
    padding: 8px 0;
    width: 100%;
    max-width: 600px; /* limit the grid width */
    box-sizing: content-box;
}

/* Individual Achievement Box: slightly larger size */
.achievement-box {
    background: var(--glass);
    border: 2px solid white; /* Add white border to inner boxes */
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Hover lift */
.achievement-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

/* Achievement Image: slightly larger size */
.achievement-box img {
    width: 100%;
    height: 200px; /* increased height */
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Achievement Title */
.achievement-box h3 {
    font-size: 1rem; /* slightly larger font size */
    margin: 6px 0;
    color: var(--accent);
}

/* Achievement Description */
.achievement-box p {
    font-size: 0.9rem; /* slightly larger font size */
    color: var(--muted);
    line-height: 1.4;
    margin: 0;
}

/* Bookshelf Box */
.bookshelf-container {
    background: var(--card);
    border: 2px solid white; /* Add white border */
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    margin-top: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-box {
    background: var(--glass);
    border: 2px solid white; /* Add white border */
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Bookshelf styles (moved from inline into central stylesheet) */
.bookshelf {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
    align-items: start;
}

.book-card {
    background: var(--card);
    border: 2px solid white; /* white sides as requested */
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.book-card img {
    width: 150px; /* fixed width to match previous appearance */
    height: 200px; /* fixed height to keep uniformity */
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.book-card h3 {
    font-size: 1.1rem;
    margin: 8px 0 4px 0;
    color: var(--accent);
}

.book-card p {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
}

/* Responsive: adjust for single column on small screens */
@media (max-width: 720px) {
    .athletic-achievements {
        grid-template-columns: 1fr;
        max-width: 320px;
    }
    .achievement-box {
        width: 100%;
    }
    .achievement-box img {
        height: 220px; /* adjust height for responsiveness */
    }
}

/* Written Books Styling */
.written-books {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 20px;
    align-items: flex-start;
}

.written-book-card {
    width: 340px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 6px 18px rgba(2,6,23,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.cover-box {
    width: 280px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(14,118,116,0.04), rgba(255,255,255,0.01));
    border-radius: 8px;
    padding: 4px;
    border: 1px solid rgba(255,255,255,0.03);
}

.cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 6px 12px rgba(2,6,23,0.5);
}

.book-title {
    font-size: 1.1rem;
    margin: 8px 0 12px 0;
    color: var(--accent);
    text-align: center;
}

.download-links {
    width: 100%;
    display: flex;
    gap: 10px;
}

.download-btn {
    display: inline-block;
    padding: 12px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #061014;
    font-weight: 700;
    font-size: 0.85rem;
    background: linear-gradient(180deg, #f0fdfa, #c9f6f4);
    border: 1px solid rgba(2,6,23,0.06);
    text-align: center;
    box-shadow: 0 4px 10px rgba(2,6,23,0.12);
    transition: transform 140ms ease, box-shadow 140ms ease;
    flex: 1;
    min-width: 0;
}

.download-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(2,6,23,0.18);
}

@media (max-width: 540px) {
    .download-links { flex-direction: column; }
    .cover-box { width: 220px; height: 300px; }
    .written-book-card { width: 280px; }
}

/* Saga Section Styling */
.saga-section {
    margin-top: 40px;
    padding: 30px;
    border-top: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid rgba(14, 118, 116, 0.4);
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.4);
}

.saga-section h2 {
    color: var(--accent);
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.saga-images-container {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.saga-image {
    flex: 0 0 auto;
    width: 280px;
    height: 340px;
    padding: 12px;
    background: var(--card);
    border: 2px solid rgba(14, 118, 116, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(2, 6, 23, 0.4);
    transition: box-shadow 200ms ease, border-color 200ms ease, transform 180ms ease;
}

.saga-image:hover {
    box-shadow: 0 10px 28px rgba(14, 118, 116, 0.4);
    border-color: var(--accent);
    transform: translateY(-4px);
}

.saga-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: none;
    border: none;
    transition: transform 180ms ease;
}

.saga-downloads {
    margin-top: 30px;
}

.saga-downloads h3 {
    color: var(--muted);
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.3rem;
}

.saga-book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.saga-book-link {
    text-decoration: none;
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.saga-book-link:hover {
    transform: translateY(-5px);
}

.saga-book-link:hover .saga-book-card {
    box-shadow: 0 10px 28px rgba(14, 118, 116, 0.4);
    border-color: var(--accent);
}

.saga-book-card {
    background: var(--card);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3/4;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: box-shadow 200ms ease, border-color 200ms ease;
}

.saga-book-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .saga-images-container {
        flex-direction: column;
    }

    .saga-image {
        max-width: 100%;
    }

    .saga-book-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

@media (max-width: 540px) {
    .saga-book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .saga-section h2 {
        font-size: 1.4rem;
    }
}

/* ===== Top Two Sections (Articles & Books) ===== */
.top-two-sections {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin: 24px 0;
}

.articles-section,
.my-books-section {
    background: var(--card);
    border: 2px solid white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.articles-section:hover,
.my-books-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

.articles-section h3,
.my-books-section h3 {
    margin: 0;
}

/* Articles Subsections Layout - Side by Side */
.articles-subsections {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.article-subsection {
    background: transparent;
    border: 1px solid rgba(14, 165, 164, 0.3);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.article-subsection:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
}

.article-subsection h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #ffffff;
    font-weight: 600;
}

.article-subsection p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
    flex-grow: 1;
}

.article-subsection .article-btn {
    margin-top: auto;
    height: 36px;
    font-size: 0.9rem;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 720px) {
    .top-two-sections {
        grid-template-columns: 1fr;
    }
    
    .articles-subsections {
        grid-template-columns: 1fr;
    }
}
