/* Client News — matches client shell: Primary-500 / #8B7BAF / #FFD700 (scope: .news-client-page) */

.news-client-page {
    --news-ink: var(--Colors-Gray-Darkest, #111111);
    --news-muted: var(--Colors-Gray-Dark, #666666);
    --news-subtle: var(--Colors-Gray-Default, #999999);
    --news-border: var(--Colors-Gray-Lighter, #e6e6e6);
    --news-surface: var(--Colors-Gray-White, #ffffff);
    --news-bg: var(--Primary-50, #f3f2f6);
    --news-brand-deep: var(--Primary-600, #5a4d7b);
    --news-brand: var(--Primary-500, #6a5d8b);
    --news-brand-light: #8b7baf;
    --news-accent: #ffd700;
    --news-accent-ink: #111111;
    --news-accent-hover: #e6c200;
    --news-shadow: rgba(17, 17, 17, 0.08);
    --news-shadow-hover: rgba(17, 17, 17, 0.14);
    --news-tag-news-bg: #fff8e6;
    --news-tag-news-ink: #7c5a0a;
    --news-tag-blog-bg: #ebebeb;
    --news-tag-blog-ink: var(--news-ink);

    font-family: var(--font-family-primary, "Rubik", system-ui, sans-serif);
    background: var(--news-bg);
    color: var(--news-ink);
    overflow-x: clip;
    padding-bottom: 64px;
}

/* ── Hero ── */
.news-client-page .news-mag-hero {
    background: linear-gradient(135deg, var(--news-brand-deep) 0%, var(--news-brand) 50%, var(--news-brand-light) 100%);
    padding: clamp(48px, 8vw, 88px) 20px clamp(56px, 8vw, 88px);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.news-mag-hero-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    opacity: 0.18;
    pointer-events: none;
}

.news-mag-hero-ring-a {
    width: 400px;
    height: 400px;
    top: -130px;
    right: -90px;
}

.news-mag-hero-ring-b {
    width: 240px;
    height: 240px;
    bottom: -70px;
    left: -50px;
}

.news-mag-hero-ring-c {
    width: 140px;
    height: 140px;
    top: 20px;
    left: 35%;
}

[dir="rtl"] .news-mag-hero-ring-a {
    right: auto;
    left: -90px;
}

[dir="rtl"] .news-mag-hero-ring-b {
    left: auto;
    right: -50px;
}

.news-mag-hero-inner {
    position: relative;
    z-index: 1;
}

.news-mag-hero-label {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 16px;
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    margin-bottom: 18px;
}

.news-mag-hero-title {
    font-size: clamp(22px, 5vw, 44px);
    font-weight: 800;
    color: #fff;
    line-height: 1.45;
    margin: 0 0 14px;
}

.news-mag-hero-lead {
    font-size: clamp(14px, 2vw, 16px);
    color: rgba(255, 255, 255, 0.82);
    max-width: 520px;
    margin: 0 auto 28px;
    line-height: 1.85;
}

.news-mag-search-wrap {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.news-mag-search-box {
    display: flex;
    align-items: center;
    background: var(--news-surface);
    border-radius: 12px;
    padding-block: 6px;
    padding-inline-start: 16px;
    padding-inline-end: 6px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    gap: 8px;
}

.news-mag-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--news-ink);
    background: transparent;
    min-width: 0;
}

.news-mag-search-input::placeholder {
    color: var(--news-subtle);
}

.news-mag-search-btn {
    background: var(--news-accent);
    color: var(--news-accent-ink);
    border: none;
    border-radius: 8px;
    padding: 9px 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s, opacity 0.2s;
}

.news-mag-search-btn:hover {
    background: var(--news-accent-hover);
    opacity: 1;
}

/* ── Wrap + tabs ── */
.news-mag-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.news-mag-tabs-section {
    padding: 36px 0 0;
}

.news-mag-tabs-row {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--news-border);
    margin-bottom: 0;
    flex-wrap: wrap;
}

.news-mag-tab-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--news-muted);
    cursor: pointer;
    padding: 10px 22px;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.news-mag-tab-btn:hover {
    color: var(--news-brand);
    background: rgba(106, 93, 139, 0.1);
}

.news-mag-tab-btn.active {
    color: var(--news-ink);
    border-bottom-color: var(--news-accent);
    background: transparent;
}

.news-mag-content-area {
    padding: 28px 0 64px;
}

/* Messages + loading */
.news-client-page .news-mag-msg {
    margin: 16px 0 0;
}

.news-mag-loading {
    padding: 24px 0;
}

.news-mag-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.news-mag-skeleton-card {
    height: 280px;
    border-radius: 16px;
    background: linear-gradient(90deg, #e4e4e4 0%, var(--news-bg) 50%, #e4e4e4 100%);
    background-size: 200% 100%;
    animation: news-mag-shimmer 1.2s ease-in-out infinite;
}

@keyframes news-mag-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.news-mag-loading-text {
    text-align: center;
    color: var(--news-muted);
    margin-top: 16px;
    font-size: 14px;
}

@media (max-width: 860px) {
    .news-mag-skeleton-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 540px) {
    .news-mag-skeleton-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Featured ── */
.news-mag-featured-wrap {
    margin-bottom: 28px;
}

.news-mag-featured-wrap[hidden] {
    display: none !important;
}

.news-mag-featured-card {
    background: var(--news-surface);
    border-radius: 18px;
    border: 1.5px solid var(--news-border);
    box-shadow: 0 2px 16px var(--news-shadow);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    text-decoration: none;
    color: inherit;
    transition: transform 0.22s, box-shadow 0.22s;
}

.news-mag-featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 36px var(--news-shadow-hover);
}

.news-mag-featured-img {
    min-height: 260px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--news-brand-deep), var(--news-brand));
}

.news-mag-featured-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-mag-featured-img .news-mag-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.32));
    z-index: 1;
}

.news-mag-featured-img .news-mag-img-ph {
    position: relative;
    z-index: 2;
    font-size: 64px;
    line-height: 1;
}

.news-mag-featured-body {
    padding: clamp(24px, 4vw, 36px) clamp(20px, 3vw, 32px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-mag-featured-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.news-mag-tag {
    display: inline-block;
    background: var(--news-tag-blog-bg);
    color: var(--news-tag-blog-ink);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 99px;
}

.news-mag-tag.news-mag-tag-news {
    background: var(--news-tag-news-bg);
    color: var(--news-tag-news-ink);
}

.news-mag-tag.news-mag-tag-blog {
    background: var(--news-tag-blog-bg);
    color: var(--news-tag-blog-ink);
}

.news-mag-meta-date {
    font-size: 12px;
    color: var(--news-subtle);
    font-weight: 500;
}

.news-mag-featured-body h2 {
    font-size: clamp(17px, 2.5vw, 24px);
    font-weight: 800;
    color: var(--news-ink);
    line-height: 1.5;
    margin: 0 0 12px;
}

.news-mag-featured-body p.news-mag-excerpt {
    font-size: 14px;
    color: var(--news-muted);
    line-height: 1.85;
    margin: 0 0 18px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-mag-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--news-ink);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 2px solid var(--news-accent);
    padding-bottom: 1px;
    transition: gap 0.2s, border-color 0.2s;
}

.news-mag-featured-card:hover .news-mag-read-more {
    gap: 10px;
    border-bottom-color: var(--news-accent-hover);
}

/* ── Grid cards ── */
.news-mag-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.news-mag-article-card {
    background: var(--news-surface);
    border-radius: 16px;
    border: 1.5px solid var(--news-border);
    box-shadow: 0 2px 14px var(--news-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.22s, box-shadow 0.22s;
}

.news-mag-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px var(--news-shadow-hover);
}

.news-mag-card-img {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    line-height: 1;
    position: relative;
    overflow: hidden;
}

.news-mag-card-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-mag-card-body {
    padding: 18px 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-mag-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.news-mag-card-body h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--news-ink);
    line-height: 1.55;
    margin: 0 0 8px;
}

.news-mag-card-body p.news-mag-card-excerpt {
    font-size: 13px;
    color: var(--news-muted);
    line-height: 1.8;
    flex: 1;
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-mag-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--news-border);
    gap: 8px;
}

.news-mag-author {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.news-mag-author-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--news-brand), var(--news-brand-deep));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: var(--news-surface);
    flex-shrink: 0;
}

.news-mag-author-name {
    font-size: 12px;
    color: var(--news-muted);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.news-mag-card-date-foot {
    font-size: 11px;
    color: var(--news-subtle);
    font-weight: 500;
    flex-shrink: 0;
}

/* Empty + load more */
.news-mag-empty-state {
    text-align: center;
    padding: 64px 20px;
}

.news-mag-empty-state[hidden] {
    display: none !important;
}

.news-mag-empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    line-height: 1;
}

.news-mag-empty-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--news-ink);
    margin: 0 0 8px;
}

.news-mag-empty-text {
    font-size: 14px;
    color: var(--news-muted);
    margin: 0;
}

.news-mag-load-more-wrap {
    text-align: center;
    margin-top: 36px;
}

.news-mag-load-more-wrap[hidden] {
    display: none !important;
}

.news-mag-load-more-btn {
    background: var(--news-surface);
    color: var(--news-ink);
    border: 2px solid var(--news-ink);
    border-radius: 10px;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.news-mag-load-more-btn:hover:not(:disabled) {
    background: var(--news-ink);
    color: var(--news-surface);
    border-color: var(--news-ink);
}

.news-mag-load-more-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Scroll reveal */
.news-mag-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.news-mag-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 860px) {
    .news-mag-featured-card {
        grid-template-columns: 1fr;
    }

    .news-mag-featured-img {
        min-height: 180px;
    }

    .news-mag-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 540px) {
    .news-mag-cards-grid {
        grid-template-columns: 1fr;
    }

    .news-mag-tabs-row {
        gap: 0;
    }

    .news-mag-tab-btn {
        font-size: 14px;
        padding: 10px 16px;
    }
}

/* Legacy message style */
.news-client-page .news-client-msg {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
}

.news-client-page .news-client-msg.err {
    background: #fff1f1;
    color: #b42318;
    border-color: #fecdca;
}

/* ── Details page ── */
.news-client-details {
    font-family: var(--font-family-primary, "Rubik", system-ui, sans-serif);
    background: var(--news-bg);
    padding: 24px 16px 48px;
    min-height: 50vh;
}

.news-client-details .news-client-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.news-client-details .news-client-back-link {
    display: inline-block;
    margin-bottom: 20px;
}

.news-client-back-link {
    color: var(--news-ink);
    font-weight: 600;
    text-decoration: none;
    font-size: 15px;
    text-underline-offset: 3px;
}

.news-client-back-link:hover {
    text-decoration: underline;
    text-decoration-color: var(--news-accent);
}

.news-client-notfound {
    text-align: center;
    padding: 48px 16px;
}

.news-client-details .news-client-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    color: var(--news-ink);
    margin: 0 0 12px;
}

.news-client-details .news-client-subtitle {
    color: var(--news-muted);
    font-size: 1.05rem;
    line-height: 1.5;
    margin: 0 0 20px;
}

.news-client-article {
    background: var(--news-surface);
    border-radius: 16px;
    border: 1.5px solid var(--news-border);
    padding: 28px 24px 36px;
    box-shadow: 0 2px 16px var(--news-shadow);
}

.news-client-article-head {
    margin-bottom: 20px;
}

.news-client-type-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--news-tag-blog-bg);
    font-size: 12px;
    font-weight: 700;
    color: var(--news-tag-blog-ink);
    margin-bottom: 12px;
}

.news-client-article-title {
    font-size: clamp(1.6rem, 3.5vw, 2.1rem);
    font-weight: 800;
    margin: 0 0 12px;
    line-height: 1.25;
    color: var(--news-ink);
}

.news-client-meta {
    font-size: 14px;
    color: var(--news-muted);
}

.news-client-meta-sep {
    margin: 0 6px;
}

/* Hero / header image: fixed 16:9 frame + cover so the image fills the area without stretching. */
.news-client-figure {
    margin: 0 auto 24px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--news-border);
    background: linear-gradient(145deg, #ece9f2 0%, #e2dde8 100%);
    position: relative;
    width: min(100%, calc(min(52vh, 520px) * 16 / 9));
    aspect-ratio: 16 / 9;
    max-height: min(52vh, 520px);
}

.news-client-hero-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.news-client-lead {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--news-muted);
    margin: 0 0 24px;
}

.news-client-body {
    font-family: var(--font-family-primary, "Rubik", system-ui, sans-serif);
    font-size: 1rem;
    line-height: 1.75;
    color: var(--news-ink);
}

.news-client-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.news-client-body iframe {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 240px;
    border: 0;
    border-radius: 8px;
    display: block;
    margin: 1em 0;
}

.news-client-body p {
    margin: 0 0 1em;
}

.news-client-body h2,
.news-client-body h3,
.news-client-body h4 {
    margin: 1.25em 0 0.5em;
    line-height: 1.3;
    font-weight: 800;
    color: var(--news-ink);
}

.news-client-body h2 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

.news-client-body h3 {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
}

.news-client-body h4 {
    font-size: 1.05rem;
    font-weight: 700;
}

.news-client-body strong,
.news-client-body b {
    font-weight: 700;
}

.news-client-body ul,
.news-client-body ol {
    margin: 0 0 1em;
    padding-inline-start: 1.35em;
}

.news-client-body li {
    margin: 0.35em 0;
}

.news-client-body blockquote {
    margin: 1em 0;
    padding: 12px 16px;
    border-inline-start: 4px solid var(--news-brand, #6a5d8b);
    background: var(--news-bg, #f3f2f6);
    color: var(--news-muted);
    border-radius: 8px;
}

.news-client-body a {
    color: var(--news-brand, #6a5d8b);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.news-client-body a:hover {
    color: var(--news-brand-deep, #5a4d7b);
}
