/*
Theme Name: AM Theme
Theme URI: https://example.com
Description: Modern multilingual theme for AM. Supports English, Persian (Dari) and Swedish. Designed to work with AM Core plugin.
Version: 1.1.0
Author: AM
License: GPLv2 or later
Text Domain: am-theme
*/

:root {
    --am-primary: #1a365d;
    --am-accent: #2b6cb0;
    --am-green: #1b7a3d;
    --am-green-dark: #145c2e;
    --am-red: #c53030;
    --am-red-glow: rgba(197, 48, 48, 0.55);
    --am-light: #f4f6f8;
    --am-text: #1a202c;
    --am-muted: #4a5568;
    --am-border: #e2e8f0;
    --am-radius: 12px;
    --am-font: Calibri, Carlito, "Segoe UI", Candara, "Century Gothic", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--am-font);
    margin: 0;
    background: var(--am-light);
    color: var(--am-text);
    line-height: 1.65;
    font-size: 1.08rem;
}

body.rtl {
    direction: rtl;
    font-family: Calibri, Carlito, "Segoe UI", Tahoma, Arial, sans-serif;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--am-accent); }

/* ========== Header: top bar + full-width green nav ========== */
.am-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.am-header-top {
    background: #fff;
    border-bottom: 1px solid var(--am-border);
}

.am-header-top-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.am-logo {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.am-logo a {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--am-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.am-logo .custom-logo-link img,
.am-logo img.custom-logo {
    max-height: 56px;
    width: auto;
}

.am-tagline {
    font-size: 0.95rem;
    color: var(--am-muted);
    font-weight: 500;
}

.am-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.am-btn-header {
    padding: 8px 16px !important;
    font-size: 1rem !important;
    background: var(--am-primary);
    color: #fff !important;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

.am-header-login {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--am-primary);
    text-decoration: none;
}

/* Full-bleed green navigation bar */
.am-nav-bar {
    background: linear-gradient(90deg, var(--am-green-dark) 0%, var(--am-green) 50%, var(--am-green-dark) 100%);
    width: 100%;
}

.am-nav-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
    display: flex;
    align-items: center;
    min-height: 52px;
}

.am-nav {
    position: relative;
    width: 100%;
}

.am-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    align-items: center;
}

.am-nav li { position: relative; }

.am-nav a {
    display: block;
    padding: 14px 16px;
    color: #fff;
    text-decoration: none;
    border-radius: 0;
    font-weight: 700;
    font-size: 1.12rem;
    white-space: nowrap;
    transition: background .15s;
}

.am-nav a:hover,
.am-nav .current-menu-item > a,
.am-nav .current-menu-ancestor > a {
    background: rgba(0,0,0,.18);
    color: #fff;
}

.am-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 12px 28px rgba(0,0,0,.15);
    padding: 8px 0;
    z-index: 250;
}

body.rtl .am-nav .sub-menu { left: auto; right: 0; }

.am-nav li:hover > .sub-menu,
.am-nav li:focus-within > .sub-menu { display: block; }

.am-nav .sub-menu a {
    color: var(--am-text);
    padding: 11px 18px;
    font-size: 1.05rem;
    font-weight: 600;
}

.am-nav .sub-menu a:hover {
    background: #edf2f7;
    color: var(--am-green-dark);
}

.am-nav .menu-item-has-children > a::after {
    content: " ▾";
    font-size: 0.75em;
    opacity: 0.85;
}

.am-nav .sub-menu .sub-menu {
    top: 0;
    left: 100%;
}
body.rtl .am-nav .sub-menu .sub-menu {
    left: auto;
    right: 100%;
}

.am-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}
.am-nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

/* ========== Hero slider (latest articles) ========== */
.am-hero-slider {
    position: relative;
    width: 100%;
    height: min(72vh, 560px);
    min-height: 360px;
    overflow: hidden;
    background: #0f172a;
}

.am-hero-slider-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.am-hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .7s ease, visibility .7s;
}

.am-hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.am-hero-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.2) 100%);
}

body.rtl .am-hero-slide-overlay {
    background: linear-gradient(-105deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.2) 100%);
}

.am-hero-slide-inner {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    padding: 40px 28px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.am-hero-date {
    display: inline-block;
    color: #f8fafc;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.am-hero-title {
    margin: 0;
    max-width: 920px;
    font-size: clamp(1.85rem, 4.2vw, 3.15rem);
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.am-hero-title a {
    color: #fff;
    text-decoration: none;
    text-shadow:
        0 0 18px var(--am-red-glow),
        0 0 2px rgba(0,0,0,.8),
        0 2px 8px rgba(0,0,0,.45);
    background: linear-gradient(transparent 60%, rgba(197, 48, 48, 0.45) 60%);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.am-hero-title a:hover {
    color: #fff5f5;
}

.am-hero-prev,
.am-hero-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.4);
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}
.am-hero-prev { left: 16px; }
.am-hero-next { right: 16px; }
body.rtl .am-hero-prev { left: auto; right: 16px; }
body.rtl .am-hero-next { right: auto; left: 16px; }
.am-hero-prev:hover,
.am-hero-next:hover { background: rgba(27, 122, 61, .9); }

.am-hero-dots {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.am-hero-dots button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.45);
    cursor: pointer;
    padding: 0;
}
.am-hero-dots button.is-active { background: #fff; transform: scale(1.2); }

/* ========== Home news blocks ========== */
.am-home-news {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 20px 48px;
}

.am-news-block {
    margin-bottom: 36px;
}

.am-news-block-inner {
    display: grid;
    grid-template-columns: 1.35fr 0.85fr;
    gap: 28px;
    background: #fff;
    border-radius: var(--am-radius);
    border: 1px solid var(--am-border);
    box-shadow: 0 8px 28px rgba(0,0,0,.05);
    padding: 22px;
    align-items: start;
}

.am-news-block.is-reverse .am-news-block-inner {
    grid-template-columns: 0.85fr 1.35fr;
}
.am-news-block.is-reverse .am-news-main { order: 2; }
.am-news-block.is-reverse .am-news-side { order: 1; }

.am-news-main-media {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    aspect-ratio: 16 / 10;
    background: #e2e8f0;
}
.am-news-main-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.am-news-main-media:hover img { transform: scale(1.03); }

.am-news-meta {
    display: block;
    font-size: 1rem;
    color: var(--am-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.am-news-main-title {
    margin: 0 0 12px;
    font-size: 1.55rem;
    line-height: 1.3;
    font-weight: 800;
}
.am-news-main-title a {
    color: var(--am-primary);
    text-decoration: none;
}
.am-news-main-title a:hover { color: var(--am-green); }

.am-news-excerpt {
    margin: 0 0 14px;
    color: var(--am-muted);
    font-size: 1.08rem;
    line-height: 1.65;
}

.am-read-more {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.08rem;
    color: var(--am-red);
    text-decoration: none;
}
.am-read-more:hover { text-decoration: underline; }

.am-news-side-heading {
    margin: 0 0 14px;
    font-size: 1.15rem;
    color: var(--am-green-dark);
    font-weight: 800;
    border-bottom: 2px solid var(--am-green);
    padding-bottom: 8px;
}

.am-news-side-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.am-news-side-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    align-items: flex-start;
    padding: 8px;
    border-radius: 10px;
    transition: background .15s;
}
.am-news-side-item:hover { background: #f0fff4; }

.am-news-side-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: #e2e8f0;
}
.am-news-side-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.am-news-side-ph {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #cbd5e0, #a0aec0);
}

.am-news-side-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.am-news-side-title {
    color: var(--am-text);
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1.35;
}
.am-news-side-text time {
    font-size: 0.9rem;
    color: var(--am-muted);
    font-weight: 600;
}

/* ========== Full story ========== */
.am-story {
    max-width: 920px;
    margin: 0 auto;
    padding: 36px 20px 60px;
}

.am-story-header { margin-bottom: 22px; }

.am-story-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    color: var(--am-muted);
    font-weight: 600;
    margin-bottom: 12px;
}
.am-story-meta-sep { opacity: .6; }
.am-story-author a {
    color: var(--am-green-dark);
    text-decoration: none;
    font-weight: 700;
}
.am-story-author a:hover { text-decoration: underline; }

.am-story-title {
    margin: 0;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    line-height: 1.25;
    color: var(--am-primary);
    font-weight: 800;
}

.am-story-featured {
    margin: 0 0 28px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0,0,0,.1);
}
.am-story-featured img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
}

.am-story-content {
    font-size: 1.12rem;
    line-height: 1.8;
}
.am-story-content p { margin: 0 0 1.15em; }
.am-story-content h2,
.am-story-content h3 { color: var(--am-primary); margin-top: 1.4em; }

.am-story-abstract {
    background: #f0fff4;
    border-left: 4px solid var(--am-green);
    padding: 16px 18px;
    margin-bottom: 24px;
    border-radius: 0 10px 10px 0;
}
body.rtl .am-story-abstract {
    border-left: none;
    border-right: 4px solid var(--am-green);
    border-radius: 10px 0 0 10px;
}
.am-story-abstract h2 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    color: var(--am-green-dark);
}

.am-btn-solid {
    display: inline-block;
    padding: 12px 24px;
    background: var(--am-primary);
    color: #fff !important;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
}

/* Related under full story */
.am-related-posts {
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--am-border);
}
.am-related-title {
    margin: 0 0 18px;
    font-size: 1.4rem;
    color: var(--am-primary);
    font-weight: 800;
}
.am-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.am-related-card {
    background: #fff;
    border: 1px solid var(--am-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,.04);
    transition: transform .15s, box-shadow .15s;
}
.am-related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,.08);
}
.am-related-thumb {
    display: block;
    aspect-ratio: 16/10;
    background: #e2e8f0;
    overflow: hidden;
}
.am-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.am-related-thumb-ph {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #cbd5e0, #a0aec0);
}
.am-related-body { padding: 12px 14px 16px; }
.am-related-body h3 {
    margin: 0 0 6px;
    font-size: 1.02rem;
    line-height: 1.35;
    font-weight: 700;
}
.am-related-body h3 a {
    color: var(--am-text);
    text-decoration: none;
}
.am-related-body h3 a:hover { color: var(--am-green); }
.am-related-body time {
    font-size: 0.9rem;
    color: var(--am-muted);
    font-weight: 600;
}

/* Buttons / sections (legacy pages) */
.am-btn {
    display: inline-block;
    padding: 12px 28px;
    background: #fff;
    color: var(--am-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    transition: transform .15s;
}
.am-btn:hover { transform: translateY(-2px); }
.am-btn-outline {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    margin-left: 12px;
}
body.rtl .am-btn-outline { margin-left: 0; margin-right: 12px; }

.am-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 20px;
}
.am-section h2 {
    font-size: 2rem;
    color: var(--am-primary);
    margin: 0 0 12px;
    text-align: center;
    font-weight: 800;
}
.am-section .section-lead {
    text-align: center;
    color: var(--am-muted);
    max-width: 720px;
    margin: 0 auto 36px;
    font-size: 1.1rem;
}

.am-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.am-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 12px rgba(0,0,0,.05);
    border: 1px solid #edf2f7;
}
.am-card h3 {
    margin: 0 0 10px;
    color: var(--am-primary);
    font-size: 1.25rem;
    font-weight: 700;
}
.am-card p {
    margin: 0;
    color: var(--am-muted);
    font-size: 1.05rem;
}

.am-footer {
    background: var(--am-primary);
    color: #cbd5e0;
    padding: 44px 20px 22px;
    margin-top: 48px;
}
.am-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}
.am-footer h4 { color: #fff; margin: 0 0 12px; font-size: 1.15rem; }
.am-footer a { color: #a0aec0; text-decoration: none; font-size: 1.02rem; }
.am-footer a:hover { color: #fff; }
.am-footer-bottom {
    max-width: 1200px;
    margin: 30px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.15);
    text-align: center;
    font-size: 0.95rem;
}

.am-content {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    font-size: 1.1rem;
}
.am-dashboard {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.05);
}
.am-dashboard ul { list-style: none; padding: 0; }
.am-dashboard li { padding: 12px 0; border-bottom: 1px solid #edf2f7; }
.am-dashboard a { color: var(--am-accent); text-decoration: none; font-weight: 600; font-size: 1.08rem; }

/* Language switcher */
.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: 6px 11px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.95rem;
    color: var(--am-text);
    border: 1px solid transparent;
    font-weight: 600;
}
.am-lang-switcher li.active a,
.am-lang-inline li.active a {
    background: var(--am-primary);
    color: #fff;
}
.am-lang-dropdown { position: relative; }
.am-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
}
.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;
}
body.rtl .am-lang-menu { right: auto; left: 0; }
.am-lang-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    text-decoration: none;
    color: var(--am-text);
    font-size: 0.95rem;
}
.am-lang-menu a:hover { background: #edf2f7; }

/* Reveal */
.am-reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.am-reveal.is-visible { opacity: 1; transform: none; }
.am-reveal-fade { transform: none; }

.am-empty-archive { text-align: center; color: var(--am-muted); font-size: 1.1rem; }

@media (max-width: 900px) {
    .am-news-block-inner,
    .am-news-block.is-reverse .am-news-block-inner {
        grid-template-columns: 1fr;
    }
    .am-news-block.is-reverse .am-news-main,
    .am-news-block.is-reverse .am-news-side { order: unset; }
    .am-related-grid { grid-template-columns: repeat(2, 1fr); }
    .am-hero-slider { height: min(58vh, 420px); min-height: 300px; }
}

@media (max-width: 768px) {
    body { font-size: 1.05rem; }
    .am-nav-toggle { display: flex; }
    .am-nav-bar-inner { flex-wrap: wrap; padding: 8px 12px; }
    .am-nav {
        display: none;
        width: 100%;
    }
    .am-nav.is-open {
        display: block;
        background: var(--am-green-dark);
        margin-top: 8px;
        border-radius: 8px;
        overflow: hidden;
    }
    .am-nav > ul,
    .am-nav ul.menu {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    .am-nav a { padding: 14px 16px; }
    .am-nav .sub-menu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        background: rgba(0,0,0,.15);
        display: none;
    }
    .am-nav li.is-submenu-open > .sub-menu { display: block; }
    .am-nav li:hover > .sub-menu { display: none; }
    .am-nav li.is-submenu-open:hover > .sub-menu { display: block; }
    .am-nav .sub-menu a { color: #fff; }
    .am-related-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
    .am-related-grid { grid-template-columns: 1fr; }
    .am-hero-title { font-size: 1.55rem; }
}


/* ========== Members directory ========== */
.am-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.am-member-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #edf2f7;
    box-shadow: 0 4px 12px rgba(0,0,0,.04);
    text-align: center;
    transition: box-shadow .2s;
}

.am-member-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

.am-member-photo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
}

.am-member-info h3 {
    margin: 0 0 4px;
    font-size: 1.15rem;
}

.am-member-info h3 a {
    color: var(--am-primary);
    text-decoration: none;
}

.am-member-type {
    display: inline-block;
    font-size: 0.8rem;
    background: #ebf8ff;
    color: var(--am-accent);
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.am-member-info .org,
.am-member-info .area {
    margin: 4px 0;
    font-size: 0.9rem;
    color: var(--am-muted);
}

.am-member-info .bio-excerpt {
    font-size: 0.9rem;
    color: #4a5568;
    margin: 10px 0;
}

.am-btn-sm {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    background: var(--am-primary);
    color: #fff !important;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
}

.am-btn-sm:hover {
    background: var(--am-accent);
}

/* Public profile page */
.am-public-profile {
    max-width: 900px;
    margin: 0 auto;
}

.am-public-header {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e2e8f0;
}

.am-public-photo img {
    width: 180px;
    height: 180px;
    border-radius: 12px;
    object-fit: cover;
}

.am-public-meta h1 {
    margin: 0 0 8px;
    color: var(--am-primary);
}

.am-public-meta .type {
    display: inline-block;
    background: #ebf8ff;
    color: var(--am-accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.am-public-bio,
.am-public-files,
.am-public-works {
    margin-top: 28px;
}

.am-public-files ul,
.am-public-works ul {
    padding-left: 20px;
}

body.rtl .am-public-files ul,
body.rtl .am-public-works ul {
    padding-left: 0;
    padding-right: 20px;
}

/* Organizational position under Full Member */
.am-member-position {
    margin: 4px 0 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--am-primary);
}
.am-public-meta .am-member-position {
    margin: 0 0 12px;
}
.am-author-info .am-member-position {
    margin: 0 0 6px;
    font-size: 0.9rem;
    color: var(--am-accent);
}

/* Membership page */
.am-membership-page {
    max-width: 1000px;
    margin: 0 auto;
}
.am-membership-intro {
    text-align: center;
    margin-bottom: 40px;
}
.am-membership-intro h2 {
    color: var(--am-primary);
    margin-bottom: 12px;
}
.am-membership-card h4 {
    margin: 16px 0 8px;
    font-size: 1rem;
    color: var(--am-text);
}
.am-membership-card ul {
    margin: 0 0 16px;
    padding-left: 20px;
    color: var(--am-muted);
    font-size: 0.95rem;
}
body.rtl .am-membership-card ul {
    padding-left: 0;
    padding-right: 20px;
}
.am-membership-cta {
    margin-top: 16px;
}
.am-membership-cta .am-btn {
    background: var(--am-primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
}
.am-membership-cta .am-btn-outline {
    background: transparent;
    border: 2px solid var(--am-primary);
    color: var(--am-primary);
}
.am-membership-form-section {
    margin-top: 50px;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #edf2f7;
    box-shadow: 0 4px 12px rgba(0,0,0,.04);
}
.am-membership-form-section h2 {
    margin-top: 0;
    color: var(--am-primary);
}

/* Archives */
.am-archive-header {
    text-align: center;
    margin-bottom: 36px;
}
.am-archive-header h1 {
    color: var(--am-primary);
    margin-bottom: 8px;
}
.am-archive-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.am-archive-item {
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.am-archive-item h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}
.am-archive-item h2 a {
    color: var(--am-primary);
    text-decoration: none;
}
.am-archive-item h2 a:hover {
    color: var(--am-accent);
}
.am-archive-item .am-meta {
    font-size: 0.9rem;
    color: var(--am-muted);
    margin-bottom: 10px;
}
.am-archive-item .excerpt {
    color: #4a5568;
    margin-bottom: 12px;
    font-size: 0.95rem;
}
.am-empty-archive {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px dashed #cbd5e0;
    color: var(--am-muted);
}

/* Latest news on homepage */
.am-news-card h3 {
    margin: 8px 0;
    font-size: 1.1rem;
}
.am-news-card h3 a {
    color: var(--am-primary);
    text-decoration: none;
}
.am-news-card h3 a:hover {
    color: var(--am-accent);
}
.am-news-type {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #ebf8ff;
    color: var(--am-accent);
    padding: 2px 8px;
    border-radius: 12px;
}
.am-news-card .am-meta {
    font-size: 0.85rem;
    color: var(--am-muted);
    margin: 0 0 8px;
}

/* ===== Scroll reveal ===== */
.am-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    will-change: opacity, transform;
}
.am-reveal-fade {
    transform: translateY(12px);
}
.am-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.am-reveal-up.is-visible {
    transform: translateY(0);
}

/* Stagger children inside visible sections */
.am-reveal.is-visible .am-card {
    animation: amFadeUp 0.55s ease both;
}
.am-reveal.is-visible .am-card:nth-child(2) { animation-delay: 0.08s; }
.am-reveal.is-visible .am-card:nth-child(3) { animation-delay: 0.16s; }
.am-reveal.is-visible .am-card:nth-child(4) { animation-delay: 0.24s; }

@keyframes amFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .am-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .am-reveal.is-visible .am-card {
        animation: none;
    }
}

/* Hero parallax (driven by --am-parallax) */
.am-hero {
    position: relative;
    overflow: hidden;
}
.am-hero h1,
.am-hero p,
.am-hero .am-btn,
.am-hero .am-btn-outline {
    transform: translateY(var(--am-parallax, 0px));
    transition: transform 0.1s linear;
}

/* ===== News slider ===== */
.am-news-slider {
    position: relative;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 48px;
}
.am-slider-viewport {
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(0,0,0,.08);
    background: #fff;
    border: 1px solid #edf2f7;
}
.am-slider-track {
    display: flex;
    transition: transform 0.45s ease;
    will-change: transform;
}
.am-slide {
    flex: 0 0 100%;
    min-width: 100%;
    box-sizing: border-box;
}
.am-slide-inner {
    display: grid;
    grid-template-columns: 1.1fr 1.2fr;
    min-height: 280px;
}
.am-slide-media {
    background-size: cover;
    background-position: center;
    min-height: 220px;
}
.am-slide-media-placeholder {
    background: linear-gradient(135deg, var(--am-primary) 0%, var(--am-accent) 100%);
    opacity: 0.9;
}
.am-slide-body {
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.am-slide-body h3 {
    margin: 10px 0 8px;
    font-size: 1.35rem;
    line-height: 1.3;
}
.am-slide-body h3 a {
    color: var(--am-primary);
    text-decoration: none;
}
.am-slide-body h3 a:hover {
    color: var(--am-accent);
}
.am-slider-prev,
.am-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: var(--am-primary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.am-slider-prev { left: 0; }
.am-slider-next { right: 0; }
.am-slider-prev:hover,
.am-slider-next:hover {
    background: var(--am-primary);
    color: #fff;
    border-color: var(--am-primary);
}
.am-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}
.am-slider-dots button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #cbd5e0;
    cursor: pointer;
    padding: 0;
}
.am-slider-dots button.is-active {
    background: var(--am-primary);
    transform: scale(1.15);
}

@media (max-width: 700px) {
    .am-news-slider {
        padding: 0 36px;
    }
    .am-slide-inner {
        grid-template-columns: 1fr;
    }
    .am-slide-media {
        min-height: 160px;
    }
}

body.rtl .am-slider-prev { left: auto; right: 0; }
body.rtl .am-slider-next { right: auto; left: 0; }


/* Larger titles site-wide */
.am-hero h1 {
    font-size: 2.85rem;
}
.am-section h2 {
    font-size: 2.05rem;
}
.am-card h3,
.am-slide-body h3 {
    font-size: 1.25rem;
}
.am-logo a {
    font-size: 1.55rem;
}

/* Hero with optional background image */
.am-hero.am-hero-has-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}
.am-hero.am-hero-has-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26,54,93,0.72) 0%, rgba(43,108,176,0.65) 100%);
    z-index: 0;
}
.am-hero.am-hero-has-image > * {
    position: relative;
    z-index: 1;
}

/* Hide WordPress logo in frontend admin bar (logged-in users) */
#wpadminbar #wp-admin-bar-wp-logo {
    display: none;
}

/* Default post icon / missing avatar: softer placeholder, no WP branding */
.avatar-default,
img.avatar[src*="gravatar.com/avatar"] {
    border-radius: 50%;
}

.am-logo .custom-logo-link { display: inline-block; line-height: 0; }
.am-logo .custom-logo,
.am-logo img {
    max-height: 48px;
    width: auto;
}