/* --- MODERN & CLEAN THEME --- */

/* 1. General Setup & Variables */
:root {
    --primary-color: #C0A062;
    --bg-warm-start: #242021;
    --bg-warm-end: #181516;
    --surface-color: #1E1E1E;
    --border-color: rgba(255, 255, 255, 0.1);
    --text-color: #b3b3b3;
    --heading-color: #ffffff;
    --title-font: 'Poppins', sans-serif;
    --body-font: 'Inter', sans-serif;
    --hebrew-font: 'Assistant', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    color: var(--text-color);
    background: radial-gradient(ellipse at center, var(--bg-warm-start) 0%, var(--bg-warm-end) 100%);
    background-attachment: fixed;
    text-align: center;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 2. Modern Header and Navigation */
header {
    padding: 1rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(18, 18, 18, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    font-family: var(--title-font);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--heading-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-brand:hover {
    color: var(--primary-color);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
}

nav ul .nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

nav ul .nav-link:hover {
    color: var(--heading-color);
    background-color: var(--surface-color);
}

nav ul .nav-link.active {
    color: var(--bg-warm-end);
    background-color: var(--primary-color);
    font-weight: 500;
}

/* 3. Main Content & Animations */
main {
    padding: 8rem 1rem 4rem;
}

.content-section {
    display: none;
    max-width: 1000px;
    margin: 0 auto;
}

.content-section.active {
    display: block;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-section.active > * {
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}
.content-section.active > *:nth-child(2) { animation-delay: 0.3s; }
.content-section.active > *:nth-child(3) { animation-delay: 0.4s; }
.content-section.active > *:nth-child(4) { animation-delay: 0.5s; }

/* 4. Section-Specific Styles */

/* Home Section */
.profile-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    margin-bottom: 2rem;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

.main-title {
    font-family: var(--title-font);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--heading-color);
}

.about-text {
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-size: 1.1rem;
    line-height: 1.7;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.4rem;
    margin: 0 1rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* General Section Title */
.section-title {
    font-family: var(--title-font);
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--heading-color);
}

/* Author Section */
.author-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
}

.book-showcase {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    max-width: 900px;
    width: 100%;
    transition: all 0.4s ease;
}

.book-showcase:hover {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--primary-color) 40%, transparent);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 20px color-mix(in srgb, var(--primary-color) 25%, transparent);
}

.book-cover-img {
    max-width: 250px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transition: transform 0.4s ease;
    flex-shrink: 0;
}

.book-cover-img:hover {
    transform: scale(1.05);
}

.book-description {
    text-align: right;
    direction: rtl;
}

.book-description h3 {
    font-family: var(--title-font);
    font-size: 2rem;
    font-weight: 500;
    color: var(--heading-color);
    margin-bottom: 1rem;
}

.book-description p {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.book-links-container {
    width: 100%;
    max-width: 700px;
}

.book-links-container h4 {
    font-family: var(--title-font);
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--heading-color);
}

.book-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.book-link {
    background: transparent;
    color: var(--primary-color);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    border: 1px solid var(--primary-color);
    transition: all 0.3s ease;
    direction: rtl;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-grow: 1;
    min-width: 150px;
}

.book-link:hover {
    background: var(--primary-color);
    color: var(--bg-warm-end);
}

/* Painter Section */
.gallery-intro {
    margin-bottom: 3rem;
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    /* Removed cursor: pointer because there is no click action yet */
    background-color: var(--surface-color);
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4), 0 0 20px color-mix(in srgb, var(--primary-color) 40%, transparent);
    z-index: 10;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.4s ease;
}

.gallery-item:hover img {
    opacity: 0.85;
}

/* 5. Responsive Adjustments */
@media (max-width: 768px) {
    .main-title { font-size: 2.8rem; }
    .section-title { font-size: 2.2rem; }

    nav {
        flex-direction: column;
        gap: 1rem;
    }

    .book-showcase {
        flex-direction: column;
        padding: 1.5rem;
        gap: 2rem;
    }

    .book-description {
        text-align: right;
    }
}

/* 6. Hebrew Font Overrides */
#author .section-title,
#author .book-description h3,
#author .book-links-container h4 {
    font-family: var(--hebrew-font);
}

.book-description p {
    font-family: var(--hebrew-font);
    font-size: 1.1rem;
    line-height: 1.9;
}

.book-link {
    font-family: var(--hebrew-font);
    font-weight: 700;
}

/* 7. Accessibility Helpers (Required by Law) */
.skip-link {
    position: absolute;
    top: -40px;
    right: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    z-index: 1001; /* Higher than header */
    transition: top 0.3s;
    text-decoration: none;
    font-family: var(--hebrew-font);
    border-radius: 0 0 0 5px;
}

.skip-link:focus {
    top: 0;
}

/* Focus indicator for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 4px;
}

/* --- ACCESSIBILITY TOOLBAR STYLES --- */

/* The Floating Button */
.a11y-toolbar-container {
    position: fixed;
    bottom: 20px;
    left: 20px; /* Left side for Hebrew sites usually, or right if preferred */
    z-index: 9999;
    font-family: var(--hebrew-font);
}

.a11y-btn {
    background: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.a11y-btn:hover, .a11y-btn:focus {
    transform: scale(1.1);
}

/* The Menu */
.a11y-menu {
    display: none; /* Hidden by default */
    position: absolute;
    bottom: 60px;
    left: 0;
    background: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 10px;
    width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    flex-direction: column;
    gap: 8px;
}

.a11y-menu.open {
    display: flex;
}

.a11y-menu button {
    background: #f0f0f0;
    border: 1px solid #ccc;
    padding: 8px;
    cursor: pointer;
    font-family: var(--hebrew-font);
    font-weight: bold;
    text-align: right;
    transition: background 0.2s;
    color: #000;
}

.a11y-menu button:hover, .a11y-menu button:focus {
    background: var(--primary-color);
    color: #fff;
}

/* --- ACCESSIBILITY MODES (Applied via JS) --- */

/* 1. Large Text Mode */
body.a11y-large-text {
    font-size: 125%; /* Increase base font size */
}

/* 2. High Contrast Mode (Yellow on Black) */
body.a11y-high-contrast {
    background: #000 !important;
    color: #ffff00 !important;
}

body.a11y-high-contrast * {
    background-color: #000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body.a11y-high-contrast img {
    filter: grayscale(100%) contrast(120%);
}

/* 3. Highlight Links */
body.a11y-links-highlight a {
    text-decoration: underline !important;
    background-color: #000 !important;
    color: #ffff00 !important;
    font-weight: bold;
}