/**
 * CSS for styling the Book Details section generated by the [book_details] shortcode.
 * Plugin: Core Tabsier Center
 */

/* Main container for the book details */
.book-details {
    margin-top: 2em; /* Add some space above the section */
    margin-bottom: 2em; /* Add some space below the section */
    padding: 1.5em; /* Add padding inside the container */
    border: 1px solid #e0e0e0; /* Add a light border */
    border-radius: 8px; /* Add rounded corners */
    background-color: #f9f9f9; /* Add a subtle background color */
    font-family: sans-serif; /* Use a common sans-serif font */
    font-size: 0.95em; /* Slightly smaller font size */
    line-height: 1.6; /* Improve readability */
    clear: both; /* Ensure it doesn't interfere with floated elements */
}

/* Hide the H3 heading visually, but keep it for screen readers */
.book-details .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 !important;
    width: 1px;
    word-wrap: normal !important;
}

/* The list containing all the book details */
.book-details-list {
    list-style: none; /* Remove default bullet points */
    padding: 0; /* Remove default padding */
    margin: 0; /* Remove default margin */
}

/* Each individual detail item (e.g., Author, ISBN) */
.book-detail-item {
    margin-bottom: 0.75em; /* Space between detail items */
    padding-bottom: 0.75em; /* Add padding below each item */
    border-bottom: 1px dashed #eee; /* Add a subtle separator line */
    display: flex; /* Use flexbox for alignment */
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
    gap: 0.5em; /* Space between label and value */
}

/* Remove bottom border/padding from the last item */
.book-detail-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* The label for each detail (e.g., "Author:") */
.book-detail-label {
    font-weight: bold; /* Make labels bold */
    color: #333; /* Darker color for labels */
    /* Optional: uncomment for fixed width labels */
    /* flex-basis: 120px; */ /* Set a base width for the label */
    /* flex-shrink: 0; */ /* Prevent label from shrinking */
}

/* Specific styling for certain elements if needed */
.book-detail-item.book-isbn span[itemprop="isbn"] {
    font-family: monospace; /* Use monospace font for ISBN */
}

/* Add some basic responsiveness */
@media (max-width: 600px) {
    .book-details {
        padding: 1em;
        font-size: 0.9em;
    }

    .book-detail-item {
        flex-direction: column; /* Stack label and value vertically */
        gap: 0.2em; /* Reduce gap */
        align-items: flex-start; /* Align items to the start */
    }

    .book-detail-label {
        margin-bottom: 0.2em; /* Add a little space below the label when stacked */
    }
}







/* --- Base & Reset --- */
:root {
    --font-primary: 'Inter', sans-serif;
    --font-arabic: 'Almarai', sans-serif;

    --color-primary-red-700: #b45309;
    --color-primary-red-900: #78350f;
    --color-primary-red-600: #d97706;
    --color-primary-red-400: #fbbf24;
    --color-primary-red-500: #f59e0b;
    --color-primary-red-800: #92400e;


    --color-blue-gray-50: #f8fafc;
    --color-blue-gray-100: #f1f5f9;
    --color-blue-gray-200: #e2e8f0;
    --color-blue-gray-300: #cbd5e1;
    --color-blue-gray-500: #64748b;
    --color-blue-gray-600: #475569;
    --color-blue-gray-700: #334155;
    --color-blue-gray-800: #1e293b;
    --color-blue-gray-900: #0f172a;

    --color-gray-300: #d1d5db;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;


    --color-yellow-400: #facc15;
    --color-red-400: #f87171;
    --color-red-500: #ef4444;
    --color-red-600: #dc2626;
    --color-teal-500: #14b8a6;
    --color-teal-600: #0d9488;
    --color-teal-700: #0f766e;
    --color-green-100: #dcfce7;
    --color-green-500: #22c55e;
    --color-green-800: #166534;
    --color-white: #ffffff;
    --color-black: #000000;

    --spacing-unit: 8px;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --ring-opacity: 0.05;

    --body-font-size: 16px;
    --line-height-base: 1.6;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%; /* Base font size */
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-blue-gray-50);
    padding: calc(var(--spacing-unit) * 2); /* 16px */
    color: var(--color-blue-gray-700);
    line-height: var(--line-height-base);
    font-size: var(--body-font-size);
}

/* Apply Almarai specifically to Arabic text elements */
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3, [lang="ar"] h4,
[lang="ar"] p, [lang="ar"] span, [lang="ar"] button, [lang="ar"] a,
[lang="ar"] dt, [lang="ar"] dd, [lang="ar"] li {
    font-family: var(--font-arabic), var(--font-primary);
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

button, input, select, textarea {
    font: inherit;
}

a {
    color: var(--color-primary-red-700);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--color-primary-red-900);
    text-decoration: underline;
}

/* Focus Styles for Accessibility */
*:focus-visible {
    outline: 3px solid var(--color-primary-red-500);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.3); /* Optional softer glow */
    border-radius: 2px; /* Slight rounding for the outline */
}
/* Remove default outline when focus-visible is supported */
*:focus:not(:focus-visible) {
    outline: none;
}


/* --- Layout --- */
.page-container {
    padding: calc(var(--spacing-unit) * 2); /* 16px */
    box-shadow: var(--shadow-md);
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    display: grid;
    grid-template-columns: 1fr; /* Default: single column */
    gap: calc(var(--spacing-unit) * 4); /* 32px */
}

@media (min-width: 768px) { /* Medium screens and up */
    body {
        padding: calc(var(--spacing-unit) * 4); /* 32px */
    }
    .page-container {
        padding: calc(var(--spacing-unit) * 4); /* 32px */
        grid-template-columns: 1fr 2fr 1fr; /* 3 columns: left, main (wider), right */
    }
}

/* --- Left Aside (Book Cover & Actions) --- */
.left-aside {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 3); /* 24px */
}

.cover-container {
    position: relative;
    display: flex;
    justify-content: center; /* Center image horizontally */
}

.cover-wrapper {
    position: relative;
    width: 100%;
    max-width: 250px; /* Max width for the image */
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, var(--ring-opacity));
}

.cover-wrapper img {
    transition: transform 0.3s ease, opacity 0.3s ease;
    object-fit: cover;
    width: 100%;
}
.cover-wrapper:hover img {
    opacity: 0.9;
    transform: scale(1.05);
}

.left-aside-actions {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2); /* 16px */
}

.review-wishlist {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.review-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
}
.review-stars svg {
    width: 16px;
    height: 16px;
}
.star-yellow { color: var(--color-yellow-400); }
.star-gray { color: var(--color-gray-300); }

.wishlist-button {
    background: none;
    border: none;
    padding: calc(var(--spacing-unit) / 2); /* 4px */
    color: var(--color-red-400);
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}
.wishlist-button:hover {
    color: var(--color-red-500);
    transform: scale(1.1);
}
.wishlist-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.nominate-follow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--spacing-unit) * 2); /* 16px */
    padding-top: var(--spacing-unit); /* 8px */
}

.nominate-follow-item {
    display: flex; /* Use flex for internal button structure */
    box-shadow: var(--shadow-sm);
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--color-blue-gray-200);
}

.nominate-follow-button {
    flex-grow: 1;
    border: none;
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 1.5); /* 8px 12px */
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--color-blue-gray-700);
    background-color: transparent; /* Inherit from container */
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease;
    line-height: 1; /* Adjust for better vertical centering */
    height: 28px; /* Fixed height */
}
.nominate-follow-button:hover {
    background-color: var(--color-blue-gray-300);
}
.nominate-follow-button span {
    font-weight: 400;
    color: var(--color-blue-gray-500);
}

.nominate-follow-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background-color: var(--color-blue-gray-300);
    color: var(--color-blue-gray-600);
}
.nominate-follow-icon svg {
    width: 16px;
    height: 16px;
}

/* --- Action Buttons --- */
.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    text-align: center;
    font-weight: 700;
    transition: background-color 0.2s ease, background-image 0.2s ease;
    height: 40px;
    font-size: 14px;
    color: var(--color-white);
}
.action-button-text {
    flex-grow: 1;
    padding: var(--spacing-unit) 0; /* 8px */
}
.action-button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch; /* Make icon background full height */
    padding: 0 calc(var(--spacing-unit) * 1.5); /* 12px */
    transition: background-color 0.2s ease;
}
.action-button-icon svg {
    width: 20px;
    height: 20px;
}

.btn-buy-paper {
    background-color: var(--color-teal-500);
}
.btn-buy-paper:hover {
    background-color: var(--color-teal-600);
}
.btn-buy-paper.action-button-icon {
    background-color: var(--color-teal-600);
}
.btn-buy-paper:hover.action-button-icon {
    background-color: var(--color-teal-700);
}

.btn-notify-read {
    background-image: linear-gradient(to right, var(--color-primary-red-600), var(--color-primary-red-400));
    height: 36px; /* Slightly smaller */
}
.btn-notify-read:hover {
    background-image: linear-gradient(to right, var(--color-primary-red-700), var(--color-primary-red-500));
}
.btn-notify-read.action-button-text {
    font-size: 12px;
}
.btn-notify-read.action-button-icon {
    width: 36px; /* Fixed width */
    padding: var(--spacing-unit); /* 8px */
    background-color: var(--color-primary-red-700);
}
.btn-notify-read:hover.action-button-icon {
    background-color: var(--color-primary-red-800);
}
.btn-notify-read.action-button-icon svg {
    width: 16px;
    height: 16px;
}

.btn-add-review {
    background-color: var(--color-gray-500);
    height: 36px; /* Slightly smaller */
}
.btn-add-review:hover {
    background-color: var(--color-gray-600);
}
.btn-add-review.action-button-icon {
    width: 36px; /* Fixed width */
    padding: var(--spacing-unit); /* 8px */
    background-color: var(--color-gray-600);
}
.btn-add-review:hover.action-button-icon {
    background-color: var(--color-gray-700);
}
.btn-add-review.action-button-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--color-white);
}

/* --- Price & Shipping Details --- */
.price-details {
    padding-top: calc(var(--spacing-unit) * 3); /* 24px */
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit); /* 8px */
}
.price-details div {
    display: flex;
    align-items: baseline;
}
.price-details dt {
    font-size: 12px;
    font-weight: 600;
    width: 48px; /* Fixed width for alignment */
    text-align: right;
    white-space: nowrap;
    color: var(--color-blue-gray-500);
    margin-inline-end: var(--spacing-unit); /* 8px */
}
.price-details dd {
    display: flex; /* Align items within dd */
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping if needed */
    gap: calc(var(--spacing-unit) / 2); /* 4px */
}

.price-before {
    text-decoration: line-through;
    color: var(--color-red-600);
    font-weight: 600;
    font-size: 14px;
}
.price-after {
    font-weight: 800;
    color: var(--color-blue-gray-800);
    font-size: 18px;
}
.discount-badge {
    font-weight: 700;
    font-size: 12px;
    color: var(--color-green-800);
    background-color: var(--color-green-100);
    border-radius: 9999px;
    white-space: nowrap;
    padding: 2px calc(var(--spacing-unit)); /* 2px 8px */
}

.shipping-returns {
    padding-top: calc(var(--spacing-unit) * 2); /* 16px */
    margin-top: calc(var(--spacing-unit) * 2); /* 16px */
    border-top: 1px solid var(--color-blue-gray-100);
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.5); /* 12px */
}
.shipping-returns-item {
    display: flex;
    align-items: flex-start; /* Align icon top */
    gap: var(--spacing-unit); /* 8px */
}
.shipping-returns-item svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px; /* Fine-tune vertical alignment */
}
.icon-shipping { color: var(--color-primary-red-600); }
.icon-secure { color: var(--color-green-500); }

.shipping-returns-text {
    font-size: 12px;
}
.shipping-returns-text-title {
    font-weight: 600;
    color: var(--color-blue-gray-700);
    display: block; /* Ensure it takes its own line */
}
.shipping-returns-text-detail {
    color: var(--color-blue-gray-500);
}
.shipping-returns-text-detail span {
    font-weight: 600;
}

/* --- Main Article --- */
.main-article header {
    margin-bottom: calc(var(--spacing-unit) * 4); /* 32px */
}
.article-title {
    padding-bottom: var(--spacing-unit); /* 8px */
    font-size: 24px; /* Adjust as needed */
    font-weight: 800;
    color: var(--color-blue-gray-800);
    line-height: 1.3;
}
@media (min-width: 768px) {
    .article-title {
        font-size: 30px; /* Larger on bigger screens */
    }
}

.article-header-actions {
    display: flex;
    justify-content: space-between; /* Keep space between title block and potential right elements */
    align-items: flex-start;
}
.article-header-left {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit); /* 8px */
}
.article-header-meta {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2); /* 16px */
}

.section-title {
    display: inline-flex; /* Allows border-bottom to fit content */
    align-items: center;
    margin-top: calc(var(--spacing-unit) * 2); /* 16px */
    margin-bottom: calc(var(--spacing-unit) * 2); /* 16px */
    font-size: 18px;
    border-bottom: 4px solid var(--color-primary-red-500);
    color: var(--color-blue-gray-700);
    font-weight: 800;
    padding-bottom: calc(var(--spacing-unit) / 2); /* 4px */
}
.section-title span { /* For gradient effect if needed */
    /* Example: */
    /* background-image: linear-gradient(to left, var(--color-blue-gray-800), var(--color-blue-gray-600));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent; */
}

.book-description {
    margin-bottom: calc(var(--spacing-unit) * 3); /* 24px */
    line-height: var(--line-height-base);
    direction: rtl; /* Ensure correct direction */
}
.book-description p,.book-description span {
    margin-bottom: var(--spacing-unit); /* Space between paragraphs */
}
.book-description button { /* Read more button style */
    margin-top: 0.25rem;
    display: inline-block;
    font-weight: 600;
    color: var(--color-primary-red-700);
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    text-decoration: underline;
}
.book-description button:hover {
    color: var(--color-primary-red-900);
}

/* --- Author Section --- */
.authors-section {
    margin-top: calc(var(--spacing-unit) * 4); /* 32px */
}
.author-card {
    padding: calc(var(--spacing-unit) * 2); /* 16px */
    margin-bottom: calc(var(--spacing-unit) * 3); /* 24px */
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    background-color: var(--color-blue-gray-100); /* Slightly different background */
}
.author-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-unit); /* 8px */
    margin-bottom: calc(var(--spacing-unit) * 1.5); /* 12px */
}
.author-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--color-white);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, var(--ring-opacity));
    object-fit: cover; /* Ensure image covers the circle */
}
.author-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-blue-gray-700);
}
.author-name:hover {
    color: var(--color-blue-gray-900);
    text-decoration: underline;
}
.author-description {
    line-height: var(--line-height-base);
    color: var(--color-blue-gray-600);
    direction: rtl;
}
.author-description p,.author-description span {
    margin-bottom: var(--spacing-unit);
}

.other-works-title {
    display: inline-flex;
    align-items: center;
    margin-top: calc(var(--spacing-unit) * 2); /* 16px */
    margin-bottom: calc(var(--spacing-unit) * 2); /* 16px */
    font-size: 14px;
    border-bottom: 2px solid var(--color-primary-red-500);
    color: var(--color-blue-gray-600);
    font-weight: 600;
    padding-bottom: 2px;
}
.other-works-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-unit); /* 8px */
}
.other-works-item {
    width: 100%; /* Full width on small screens */
}
@media (min-width: 640px) { /* Small screens and up */
    .other-works-item {
        width: calc(50% - (var(--spacing-unit) / 2)); /* Two columns */
    }
}
.other-works-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-unit); /* 8px */
    font-weight: 600;
    font-size: 14px;
    color: var(--color-blue-gray-600);
}
.other-works-link:hover {
    color: var(--color-blue-gray-800);
    text-decoration: none; /* Remove underline on hover for this specific link style */
}
.other-works-link svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--color-blue-gray-500);
    fill: currentColor; /* Ensure SVG color matches text */
}
.other-works-link.truncate { /* Simple text truncation */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Metadata Aside --- */
.metadata-aside {
    /* No specific styles needed if content dictates size */
}
.metadata-list {
    font-size: 12px;
    border-radius: var(--border-radius);
    overflow: hidden; /* Clip corners */
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-blue-gray-100);
    display: flex;
    flex-direction: column;
}
.metadata-item {
    display: grid;
    grid-template-columns: 2fr 3fr; /* Ratio for label/value */
    border-bottom: 1px solid var(--color-blue-gray-100);
}
.metadata-item:last-child {
    border-bottom: none;
}
.metadata-label {
    padding: calc(var(--spacing-unit) * 1.5); /* 12px */
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    color: var(--color-blue-gray-600);
    background-color: var(--color-blue-gray-100); /* Subtle background */
}
.metadata-value {
    padding: calc(var(--spacing-unit) * 1.5); /* 12px */
    background-color: var(--color-white);
    color: var(--color-blue-gray-700);
    word-break: break-word; /* Prevent long words overflowing */
}
.metadata-value a {
    font-weight: 600;
    color: var(--color-blue-gray-700);
}
.metadata-value a:hover {
    color: var(--color-blue-gray-900);
}
.metadata-value span { /* For non-link values */
    white-space: normal; /* Allow wrapping */
}
.metadata-value.categories a {
    margin-inline-end: calc(var(--spacing-unit) / 2); /* 4px */
    display: inline-block; /* Ensure spacing works */
}

/* Utility Classes (Optional but can be helpful) */
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.block {
    display: block;
}
.hidden {
    display: none;
}
.sr-only { /* Screen reader 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;
}
