/* ==========================================================================
   تهاني عيد العرش - Tanja24
   ========================================================================== */

body.single-greeting,
body.post-type-archive-greeting {
    direction: rtl;
}

.tahani-page {
    font-family: 'Tajawal', sans-serif;
    max-width: 1150px;
    margin: 0 auto;
    padding: 0 15px 50px;
    direction: rtl;
    text-align: right;
}

.tahani-shortcode-wrap {
    margin: 20px auto;
}

/* أيقونة عامة: يمكن التحكم بحجمها ولونها بسهولة */
.tahani-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: middle;
}

/* ===== الترويسة ===== */
.tahani-hero {
    position: relative;
    text-align: center;
    padding: 55px 20px 65px;
    margin: 25px 0 45px;
    border-radius: 18px;
    background: linear-gradient(135deg, #04361f 0%, #0a5c34 55%, #0f7a45 100%);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.tahani-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(212,175,55,0.18) 0, transparent 35%),
        radial-gradient(circle at 85% 80%, rgba(212,175,55,0.15) 0, transparent 35%);
    pointer-events: none;
}

.tahani-hero .hero-star {
    width: 46px;
    height: 46px;
    margin: 0 auto 14px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.tahani-hero .hero-star svg { width: 100%; height: 100%; }

/* ===== غلاف صورة الملك في الترويسة ===== */
.tahani-hero.has-king-photo {
    background-position: center 20%;
    padding-top: 40px;
}

.tahani-hero .king-photo-frame {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0 auto 18px;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(135deg, #d4af37, #f2e4b8, #d4af37);
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

.tahani-hero .king-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #04361f;
}

.tahani-hero h1 {
    position: relative;
    color: #fff;
    font-weight: 800;
    font-size: 2.5em;
    margin: 0 0 10px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.tahani-hero p {
    position: relative;
    color: #f2e4b8;
    font-size: 1.15em;
    margin: 0;
}

.tahani-hero .gold-line {
    position: relative;
    width: 90px;
    height: 3px;
    background: #d4af37;
    margin: 18px auto 0;
    border-radius: 3px;
}

/* ===== شريط البحث ===== */
.tahani-search-bar {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 35px;
}

.tahani-search-bar input {
    width: 100%;
    max-width: 420px;
    padding: 12px 46px 12px 20px;
    border: 2px solid #e5decf;
    border-radius: 30px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1em;
    text-align: right;
    transition: border-color .2s ease, box-shadow .2s ease;
    background: #fff;
}

.tahani-search-bar input:focus {
    outline: none;
    border-color: #0f7a45;
    box-shadow: 0 0 0 4px rgba(15,122,69,0.12);
}

.tahani-search-icon {
    position: absolute;
    top: 50%;
    right: calc(50% - 210px + 16px);
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #999;
    pointer-events: none;
}

@media (max-width: 460px) {
    .tahani-search-icon { right: 32px; }
}

/* ===== الشبكة والبطاقات ===== */
.tahani-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .tahani-grid { grid-template-columns: 1fr; }
}

.tahani-card {
    position: relative;
    display: flex;
    gap: 16px;
    align-items: center;
    background: #fff;
    border: 1px solid #ece5d6;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    transition: transform .25s ease, box-shadow .25s ease;
}

.tahani-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(4,54,31,0.12);
}

.tahani-card::after {
    content: "";
    position: absolute;
    top: 0; right: 0;
    width: 60px; height: 60px;
    background: radial-gradient(circle at top right, rgba(212,175,55,0.15), transparent 70%);
    border-radius: 0 16px 0 0;
    pointer-events: none;
}

.tahani-card .flag-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    z-index: 2;
}

.tahani-card .flag-badge svg { width: 100%; height: 100%; display: block; }

.tahani-card .person-photo { flex-shrink: 0; }

.tahani-card .person-photo img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #d4af37;
}

.tahani-card .person-photo.no-photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg,#0a5c34,#0f7a45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f2e4b8;
    font-size: 1.8em;
    font-weight: 800;
    border: 3px solid #d4af37;
}

.tahani-card .person-details { flex-grow: 1; min-width: 0; }

.tahani-card .person-name {
    font-size: 1.35em;
    font-weight: 700;
    color: #04361f;
    margin: 0 0 4px;
}

.tahani-card .person-title {
    font-size: 0.95em;
    color: #b8862b;
    font-weight: 500;
    margin-bottom: 8px;
}

.tahani-card .greeting-excerpt {
    font-size: 0.98em;
    line-height: 1.7;
    color: #444;
    margin-bottom: 12px;
}

.tahani-card .read-more-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #0f7a45;
    color: #fff;
    padding: 7px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85em;
    transition: background-color .2s ease;
}

.tahani-card .read-more-link:hover { background: #04361f; color: #fff; }

.tahani-empty {
    text-align: center;
    font-size: 1.2em;
    color: #777;
    padding: 60px 0;
}

/* ==========================================================================
   صفحة التهنئة الفردية
   ========================================================================== */

.single-tahani {
    font-family: 'Tajawal', sans-serif;
    max-width: 780px;
    margin: 40px auto;
    padding: 0 15px 40px;
    direction: rtl;
}

.single-tahani-card {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0,0,0,0.07);
}

/* ===== غلاف صورة الملك أعلى صفحة التهنئة الفردية ===== */
.single-king-cover {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.single-king-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
}

.single-king-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4,54,31,0) 60%, rgba(4,54,31,0.55) 100%);
}

@media (max-width: 600px) {
    .single-king-cover { height: 160px; }
}

.single-tahani-top {
    background: linear-gradient(135deg, #04361f 0%, #0a5c34 55%, #0f7a45 100%);
    padding: 40px 25px 70px;
    text-align: center;
    position: relative;
}

.single-flag-badge {
    display: inline-flex;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #d4af37;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.single-flag-badge svg { width: 100%; height: 100%; display: block; }

.single-tahani-top h1 {
    color: #fff;
    font-size: 1.9em;
    font-weight: 800;
    margin: 0 0 8px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.single-tahani-top .person-title {
    color: #f2e4b8;
    font-size: 1.05em;
}

.single-tahani-photo {
    margin: -55px auto 0;
    width: 130px;
    height: 130px;
    position: relative;
    z-index: 2;
}

.single-tahani-photo img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.single-tahani-photo.no-photo {
    border-radius: 50%;
    background: #d4af37;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #04361f;
    font-size: 2.4em;
    font-weight: 800;
    border: 5px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.single-tahani-body {
    padding: 25px 35px 35px;
    text-align: center;
}

.single-tahani-content {
    font-size: 1.25em;
    line-height: 1.9;
    color: #333;
    text-align: justify;
    margin-bottom: 30px;
}

/* ===== أزرار المشاركة (أيقونات SVG مضمّنة تعمل دائماً) ===== */
.share-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 1px solid #eee;
    padding-top: 22px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 22px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9em;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    transition: opacity .2s ease, transform .15s ease;
}

.share-btn:hover { opacity: 0.85; color: #fff; transform: translateY(-2px); }

.share-btn .tahani-icon { width: 16px; height: 16px; flex-shrink: 0; }

.share-whatsapp { background: #25D366; }
.share-facebook { background: #1877F2; }
.share-copy     { background: #6b6b6b; }
.share-back     { background: #04361f; }

.share-copy.is-copied { background: #0f7a45; }

@media (max-width: 600px) {
    .single-tahani-top h1 { font-size: 1.5em; }
    .single-tahani-content { font-size: 1.1em; }
    .single-tahani-body { padding: 20px; }
    .share-btn span:not(.tahani-icon) { display: none; }
    .share-btn { padding: 10px; }
}
