/* ================= VARIABLES ================= */
:root {
    --bg-primary: #d5d4d3;
    --bg-secondary: #d4c9b5;
    --bg-card: #ffffff;
    --accent-gold: #8a673d;
    --accent-gold-light: #d4b896;
    --accent-gold-dark: #806038;
    --accent-brown: #3e2c21;
    --text-primary: #3a2f24;
    --text-secondary: #5c4d3e;
    --text-muted: #736554;
    --border-color: #e5ddd0;
    --shadow-soft: 0 10px 40px rgba(62, 44, 33, 0.08);
    --shadow-medium: 0 15px 50px rgba(62, 44, 33, 0.12);
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= RESET & BODY ================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: "Cairo", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    padding-top: 120px; /* Default Mobile Padding */
}

/* ================= HEADER ================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    z-index: 1000;

    padding: 16px 12px 14px;   /* زيادة المساحة العلوية والسفلية */

    background: linear-gradient(180deg, #d4c9b5 0%, #f2ede4 100%);
    border-bottom: 1px solid rgba(184, 149, 107, 0.15);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

/* Support for OLD HTML (.icon) and NEW HTML (.icon-btn) */
.icon, .icon-btn {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.icon:hover, .icon-btn:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(184, 149, 107, 0.25);
}

.icon svg, .icon-btn svg {
    width: 28px;
    height: 28px;
    stroke: var(--accent-gold);
    stroke-width: 2;
    fill: none;
    transition: var(--transition);
}

.icon:hover svg, .icon-btn:hover svg { stroke: white; }

/* Brand */
.brand {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.author-img {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: #fff;
    padding: 3px;
    margin-bottom: 2px;
    box-shadow: 0 8px 24px rgba(62, 44, 33, 0.12);
    transition: var(--transition);
}

.author-img img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 10%;
}

.brand-top {
    font-size: 14px;
    color: var(--accent-gold);
    letter-spacing: 0.5px;
    margin-bottom: 0px;
    font-weight: 600;
}

.brand h1 {
    font-family: "Amiri", serif;
    font-size: 25px;
    color: var(--accent-brown);
    font-weight: 700;
    line-height: 1.1;
}

.subtitle {
    font-family: "Amiri", serif;
    font-size: 12px;
    color: var(--text-muted);
	margin: 14px 5px 5px;
}

/* ================= BREADCRUMB ================= */
.breadcrumb-wrap {
    max-width: 900px;
    margin: 110px auto 0; /* بداية بعد الهيدر المثبت */
    padding: 12px 16px;
    background: linear-gradient(145deg, #ffffff, #f5f2ec);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(62, 44, 33, 0.05);
    border: 1px solid var(--border-color);
    z-index: 5;
    position: relative;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.crumb {
    text-decoration: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.crumb:hover {
    color: var(--accent-gold);
}

.crumb.current {
    color: var(--accent-brown);
    font-weight: 600;
}

.crumb-sep {
    width: 6px;
    height: 6px;
    background: var(--accent-gold);
    border-radius: 50%;
    opacity: 0.5;
}

.home-icon {
    font-size: 16px;
}

/* ================= MAIN CONTENT (Author Page) ================= */
.main-content {
    flex: 1;
    width: 100%;
}

.main{
max-width:1000px;
width:100%;
margin:0 auto;
padding:20px 16px 10px;
flex:1;
}
/* Page Header */
.page-header {
    padding: 40px 20px 30px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.page-title {
    font-family: "Amiri", serif;
    font-size: clamp(24px, 3vw, 32px);
    color: var(--accent-brown);
    margin-bottom: 10px;
    font-weight: 700;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 5px auto;
    line-height: 1.8;
}

/* Info Cards Grid */
.info-section {
    padding: 0 16px 30px;
}

.info-container {
    max-width: 900px;
    margin: 0 auto;
}

.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Mobile: 2 cols */
    gap: 12px;
}

.info-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition);
}

.info-badge:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.info-badge-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 149, 107, 0.1);
    border-radius: 10px;
    flex-shrink: 0;
}

.info-badge-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--accent-gold);
    stroke-width: 1.8;
    fill: none;
}

.info-badge-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 2px;
}

.info-badge-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
}

/* Biography Section */
.biography-section {
    padding: 20px 16px 40px;
}

.bio-container {
    max-width: 900px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
}

.section-title h3 {
    font-family: "Amiri", serif;
    font-size: 24px;
    color: var(--accent-brown);
    margin-bottom: 8px;
}

.section-title-line {
    width: 50px;
    height: 2px;
    background: var(--accent-gold);
    margin: 0 auto;
}

/* Bio Content */
.bio-content {
    font-family: "Amiri", serif;
    font-size: 17px;
    line-height: 2.1;
    color: var(--text-secondary);
}

.bio-intro {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255,255,255,0.7) 100%);
    border: 1px solid var(--border-color);
    border-right: 4px solid var(--accent-gold);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
}

.bio-intro p {
    margin: 0;
    position: relative;
    z-index: 1;
}

.bio-intro strong {
    color: var(--accent-gold-dark);
    font-weight: 700;
}

/* Bio Sections */
.bio-section {
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: var(--transition);
}

.bio-section:hover {
    border-color: rgba(184, 149, 107, 0.4);
    box-shadow: var(--shadow-soft);
}

.bio-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(229, 221, 208, 0.6);
}

.bio-section-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 149, 107, 0.1);
    border-radius: 8px;
}

.bio-section-icon svg {
    width: 26px;
    height: 26px;
    stroke: var(--accent-gold);
    fill: none;
    stroke-width: 1.8;
}

.bio-section h4 {
    font-family: "Amiri", serif;
    font-size: 18px;
    color: var(--text-primary);
}

.bio-section p {
    margin-bottom: 12px;
    text-align: justify;
    font-size: 16px;
}

.bio-section p:last-child {
    margin-bottom: 0;
}

.bio-section strong {
    color: var(--accent-gold-dark);
}

/* Books Highlight Tags */
.books-highlight {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(229, 221, 208, 0.6);
}

.book-tag {
    padding: 6px 12px;
    background: rgba(184, 149, 107, 0.08);
    border: 1px solid rgba(184, 149, 107, 0.2);
    border-radius: 6px;
    font-family: "Cairo", sans-serif; /* Tags usually sans-serif */
    font-size: 12px;
    color: var(--accent-gold-dark);
    transition: var(--transition);
}

.book-tag:hover {
    background: rgba(184, 149, 107, 0.15);
    transform: translateY(-1px);
}

/* Quote Block */
.quote-block {
    position: relative;
    padding: 24px;
    margin: 24px 0;
    background: rgba(184, 149, 107, 0.05);
    border: 1px solid rgba(184, 149, 107, 0.2);
    border-radius: 12px;
    text-align: center;
}

.quote-block p {
    font-size: 17px;
    color: var(--text-primary);
    line-height: 1.9;
    font-style: italic;
    margin: 0;
}

/* ================= MAIN GRID (Home Page) ================= */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px 8px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    display: block;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-brown));
    transform: scaleX(0);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(62, 44, 33, 0.12);
}

.card:hover::before { transform: scaleX(1); }

.circle {
    width: 55px;
    height: 55px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #faf7f2 0%, #f0ebe0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(62, 44, 33, 0.06);
    transition: var(--transition);
}

.card:hover .circle { transform: scale(1.05); }

.circle img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1));
}

.card h3 {
    font-family: "Amiri", serif;
    font-size: 13px;
    color: var(--accent-brown);
    font-weight: 700;
    line-height: 1.3;
}

/* ================= SIDEBAR ================= */
.overlay-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.overlay-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 280px;
    height: 100vh;
    background: #fff;
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
    transition: var(--transition);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.sidebar.active { right: 0; }

.sidebar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-top h2 {
    font-family: "Amiri", serif;
    color: var(--accent-brown);
    font-size: 20px;
}

.close-btn {
    width: 32px;
    height: 32px;
    background: #f5f3ef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.close-btn:hover { background: var(--accent-gold); color: #fff; }

.menu {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #d5d4d3;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.menu-item:hover {
    transform: translateX(-5px);
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.menu-icon {
    width: 46px;
    height: 46px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

.lang-title {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.lang {
    display: flex;
    gap: 8px;
}

.lang a {
    flex: 1;
    text-align: center;
    padding: 6px 0;
    border-radius: 6px;
    background: #f5f3ef;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition);
}

.lang a.active {
    background: var(--accent-gold);
    color: white;
    font-weight: 600;
}

/* ================= SEARCH ================= */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    display: none;
    z-index: 2000;
    padding-top: 80px;
}

.search-overlay.active { display: block; }

.search-box {
    background: #fff;
    width: 90%;
    max-width: 500px;
    margin: 0 auto;
    padding: 12px 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    position: relative;
    z-index: 2001;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: "Cairo";
    background: transparent;
}

.close-search {
    cursor: pointer;
    font-size: 16px;
    color: #888;
    padding: 5px;
}

/* ================= FOOTER ================= */
.footer{
text-align:center;
padding:12px;
background:#f2ede4;
border-top:1px solid var(--border-color);
margin-top:0;
}

.footer p {
    font-size: 11px;
    color: var(--text-muted);
}
.footer{
position:fixed;
bottom:0;
left:0;
right:0;
}
/* ================= BACK TO TOP ================= */
#backToTop {
    position: fixed;
    bottom: 15px;
    left: 15px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-brown);
    color: #fff;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(62, 44, 33, 0.2);
}

#backToTop.show { opacity: 1; visibility: visible; }
#backToTop:hover { transform: translateY(-3px); }

/* ================= ANIMATIONS ================= */
.animate-in {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================================= */
/* ================= RESPONSIVE DESIGN ==================== */
/* ========================================================= */

/* Medium Screens (Tablets) */
@media (min-width: 600px) {
    .grid { gap: 18px; }
    .card h3 { font-size: 15px; }
    
    /* Author Page Responsive */
    .info-cards-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 cols for tablets */
        gap: 16px;
    }
    
    .breadcrumb-wrap {
        margin-top: 110px auto 20px;
    }
}

/* Large Screens (Desktop) */
@media (min-width: 900px) {
    body {
        padding-top: 280px; /* Large Header Space */
    }

    .header { padding: 20px 24px; }
    
    .icon, .icon-btn { width: 55px; height: 55px; }
    .icon svg, .icon-btn svg { width: 40px; height: 40px; }
    
    .author-img {
        width: 110px;
        height: 110px;
        margin-bottom: 10px;
        padding: 4px;
    }

    .brand-top { font-size: 14px; letter-spacing: 1px; margin-bottom: 2px; }
    .brand h1 { font-size: 40px; }
    .subtitle { font-size: 15px; }

    /* Home Grid Desktop */
    .grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }

    .card {
        padding: 30px 15px;
        border-radius: 18px;
    }

    .circle {
        width: 80px;
        height: 80px;
    }

    .circle img {
        width: 42px;
        height: 42px;
    }
    
    .card h3 { font-size: 17px; }

    .sidebar { width: 300px; }
    .sidebar-top h2 { font-size: 24px; }

    /* Author Page Desktop */
    .breadcrumb-wrap {
        margin-top: 0;
        position: relative;
        /* Adjust position relative to the body padding */
    }
    
    .bio-content { font-size: 19px; }
    .bio-section { padding: 30px; }
}

/* Scrolled Header Effect */
.header.scrolled {
    padding: 8px 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}
.header.scrolled .author-img { width: 40px; height: 40px; margin-bottom: 2px; padding: 2px; }
.header.scrolled h1 { font-size: 15px; }
.header.scrolled .subtitle,
.header.scrolled .brand-top { display: none; }

/* ================= BACK TO TOP ================= */

#backToTop{

position:fixed;

bottom:20px;
left:20px;

width:46px;
height:46px;

border:none;
border-radius:50%;

background:#c6b28a;   /* اللون الجديد */

color:#fff;

display:flex;
align-items:center;
justify-content:center;

cursor:pointer;

box-shadow:0 6px 18px rgba(0,0,0,0.15);

opacity:0;
visibility:hidden;

transition:0.3s;

z-index:999;

}

#backToTop svg{
width:20px;
height:20px;
}

#backToTop:hover{

background:#b49c70;

transform:translateY(-3px);

}

/* SHOW BUTTON */

#backToTop.show{

opacity:1;
visibility:visible;

}


.search-results{

width:90%;
max-width:700px;

margin:10px auto;

background:white;

border-radius:12px;

box-shadow:0 10px 30px rgba(0,0,0,0.15);

overflow:hidden;

}

.result{

display:block;

padding:14px 18px;

border-bottom:1px solid #eee;

text-decoration:none;

color:#333;

}

.result h4{

margin:0 0 4px;

font-size:16px;

}

.result p{

margin:0;

font-size:13px;

color:#777;

}

.result:hover{

background:#f5f5f5;

}


.brand {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    color: inherit !important;
}

.brand-link,
.brand-link:hover,
.brand-link:focus,
.brand-link:active,
.brand-link:visited,
.brand-link *,
.brand-link *:hover,
.brand-link *:focus,
.brand-link *:active,
.brand-link *:visited {
    text-decoration: none !important;
    color: inherit !important;
}


.footer{
  text-align:center;
  padding:18px 14px;
}

.footer p{
  margin:0;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:14px;
  line-height:1.8;
}

.footer-sep{
  opacity:.45;
}

.powered-by{
  display:inline-flex;
  align-items:center;
  gap:6px;
  text-decoration:none;
  color:inherit;
  transition:.25s ease;
}

.powered-by:hover{
  opacity:.8;
}

.powered-img{
  height:20px;
  width:auto;
  display:block;
}