/* AM Core – inherit theme fonts; Calibri stack when standalone */
body, button, input, select, textarea {
    font-family: Calibri, Carlito, "Segoe UI", Candara, Arial, sans-serif;
}
/* Prefer readable form text when theme base is larger */
.am-form,
.am-register-form,
.am-register-wrapper {
    font-size: 1.05rem;
}
.am-form label,
.am-register-form label {
    font-size: 1.05rem;
}
.am-form .description,
.am-register-form .description {
    font-size: 0.98rem;
}
.am-card.am-membership-card p,
.am-card.am-membership-card li {
    font-size: 1.02rem;
}

/* AM Core frontend styles */

.am-lang-switcher,
.am-lang-inline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    align-items: center;
}
.am-lang-switcher a,
.am-lang-inline a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.88rem;
}
.am-lang-switcher li.active a,
.am-lang-inline li.active a {
    background: #1a365d;
    color: #fff;
}
.am-flag { font-size: 1.1em; line-height: 1; }

.am-lang-dropdown { position: relative; }
.am-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}
.am-lang-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 140px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    z-index: 300;
}
.am-lang-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    text-decoration: none;
    color: #2d3748;
    font-size: 0.9rem;
}
.am-lang-menu a:hover { background: #edf2f7; }

.am-author-box {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 20px;
    margin-top: 40px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.am-author-photo {
    flex: 0 0 80px;
    width: 80px;
    max-width: 80px;
}
.am-author-photo img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
    display: block;
}
.am-author-info {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.am-author-works ul {
    margin: 8px 0 0;
    padding-left: 18px;
    padding-right: 0;
}
.am-form p { margin-bottom: 12px; }
.am-search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.am-search-form input[type="text"] {
    flex: 1;
    padding: 8px 12px;
}

/*
 * RTL / Dari: use direction only (NOT row-reverse).
 * direction:rtl already places the first flex item (photo) on the right.
 * Combining row-reverse with direction:rtl put the photo back on the left
 * and could stretch the page width.
 */
body.rtl .am-author-box,
.am-author-box[dir="rtl"] {
    flex-direction: row; /* keep normal order; direction handles side */
    direction: rtl;
    text-align: right;
}
body.rtl .am-author-info,
.am-author-box[dir="rtl"] .am-author-info {
    text-align: right;
}
body.rtl .am-author-works ul,
.am-author-box[dir="rtl"] .am-author-works ul {
    padding-left: 0;
    padding-right: 18px;
}
body.rtl .am-author-box .bio,
body.rtl .am-author-box .org,
body.rtl .am-author-box .area,
body.rtl .am-author-box .email,
body.rtl .am-author-box .website,
.am-author-box[dir="rtl"] .bio,
.am-author-box[dir="rtl"] .org,
.am-author-box[dir="rtl"] .area,
.am-author-box[dir="rtl"] .email,
.am-author-box[dir="rtl"] .website {
    text-align: right;
}

.am-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.am-member-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #edf2f7;
    text-align: center;
}
.am-member-photo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.am-member-position {
    margin: 4px 0 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a365d;
}


/* Membership type cards (register + membership page) */
.am-membership-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 24px 0 32px;
}
.am-card.am-membership-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.am-card.am-membership-card h3 {
    margin-top: 0;
    color: #1a365d;
    font-size: 1.25rem;
}
.am-card.am-membership-card h4 {
    margin: 16px 0 8px;
    font-size: 0.95rem;
    color: #2d3748;
}
.am-card.am-membership-card ul {
    margin: 0 0 16px;
    padding-left: 1.25em;
}
.am-card.am-membership-card li {
    margin-bottom: 6px;
    color: #4a5568;
}
.am-membership-cta {
    margin: 16px 0 0;
}
/* Scoped to membership/register only — do not override theme hero buttons */
.am-membership-types .am-btn,
.am-membership-cta .am-btn,
.am-register-wrapper .am-btn,
.am-membership-page .am-btn {
    display: inline-block;
    padding: 10px 18px;
    background: #1a365d;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid #1a365d;
    transition: background .15s, color .15s;
}
.am-membership-types .am-btn:hover,
.am-membership-cta .am-btn:hover,
.am-register-wrapper .am-btn:hover,
.am-membership-page .am-btn:hover {
    background: #2c5282;
    color: #fff;
}
.am-membership-types .am-btn-outline,
.am-membership-cta .am-btn-outline,
.am-register-wrapper .am-btn-outline,
.am-membership-page .am-btn-outline {
    background: transparent;
    color: #1a365d;
    border: 1px solid #1a365d;
}
.am-membership-types .am-btn-outline:hover,
.am-membership-cta .am-btn-outline:hover,
.am-register-wrapper .am-btn-outline:hover,
.am-membership-page .am-btn-outline:hover {
    background: #1a365d;
    color: #fff;
}
.am-membership-application-title {
    font-weight: 700;
}
.am-register-lead,
.am-membership-form-section > p {
    color: #4a5568;
    margin-bottom: 1.25em;
}
.am-membership-form-section {
    margin-top: 8px;
}

/* Hide theme page title on Register page so only "Membership Application" shows */
body.am-register-page .entry-title,
body.am-register-page .page-title,
body.am-register-page .wp-block-post-title,
body.am-register-page h1.entry-title,
body.am-register-page .page-header h1,
body.am-register-page .page-header .entry-title,
body.am-register-page article > header .entry-title,
body.am-register-page .entry-header .entry-title {
    display: none !important;
}

/* Related posts (plugin fallback styles) */
.am-related-posts { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #e2e8f0; }
.am-related-heading { margin: 0 0 1rem; color: #1a365d; font-size: 1.25rem; }
.am-related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .am-related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .am-related-grid { grid-template-columns: 1fr; } }
.am-related-card { background: #fff; border: 1px solid #edf2f7; border-radius: 10px; overflow: hidden; }
.am-related-media { display: block; aspect-ratio: 16/10; overflow: hidden; background: #edf2f7; }
.am-related-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.am-related-placeholder { display: block; width: 100%; height: 100%; min-height: 100px; background: #e2e8f0; }
.am-related-body { padding: 12px 14px 14px; }
.am-related-title { margin: 0 0 6px; font-size: 0.98rem; line-height: 1.35; }
.am-related-title a { color: #1a365d; text-decoration: none; }
.am-related-date { margin: 0; font-size: 0.85rem; color: #718096; }
