/* ================================================================
   News Grid Pro v2.0 — Frontend Styles
   ================================================================ */

/* ---------- Wrapper ---------- */
.ngp-wrapper { font-family: inherit; box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

/* ---------- Section Title ---------- */
.ngp-section-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 36px;
    color: #1a202c;
    font-family: Georgia, 'Times New Roman', serif;
    letter-spacing: -0.5px;
}

/* ---------- Category Filter Tabs ---------- */
.ngp-cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
    justify-content: center;
}
.ngp-cat-btn {
    padding: 8px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    color: #4a5568;
}
.ngp-cat-btn:hover, .ngp-cat-btn.active {
    background: var(--ngp-accent, #1a73e8);
    border-color: var(--ngp-accent, #1a73e8);
    color: #fff;
}

/* ================================================================
   BASE CARD
   ================================================================ */
.ngp-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 16px rgba(0,0,0,.07);
    transition: box-shadow .25s, transform .25s;
    position: relative;
    animation: ngp-fadeup .4s ease both;
}
.ngp-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,.13);
    transform: translateY(-3px);
}
@keyframes ngp-fadeup {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   IMAGE WRAP (shared)
   ================================================================ */
.ngp-card__image-wrap {
    display: block;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    flex-shrink: 0;
    width: 100%;
}
.ngp-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

/* --- placeholder --- */
.ngp-card__placeholder {
    width: 100%;
    height: 100%;
    min-height: 160px;
    background: #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ngp-card__placeholder svg { width: 72px; height: 72px; opacity: .5; }

/* ================================================================
   HOVER EFFECTS
   ================================================================ */
.ngp-hover-zoom  .ngp-card__image-wrap:hover .ngp-card__img { transform: scale(1.07); }
.ngp-hover-fade  .ngp-card__image-wrap:hover .ngp-card__img { opacity: .72; }
.ngp-hover-slide-up .ngp-card__image-wrap:hover .ngp-card__img { transform: translateY(-6px) scale(1.03); }

/* ================================================================
   THUMBNAIL SHAPES  (standard + side layouts)
   ================================================================ */
/* Landscape 16:9 */
.ngp-layout-standard.ngp-shape-landscape .ngp-card__image-wrap,
.ngp-layout-side.ngp-shape-landscape     .ngp-card__image-wrap {
    aspect-ratio: 16 / 9;
}
/* Portrait 3:4 */
.ngp-layout-standard.ngp-shape-portrait .ngp-card__image-wrap,
.ngp-layout-side.ngp-shape-portrait     .ngp-card__image-wrap {
    aspect-ratio: 3 / 4;
}
/* Square 1:1 */
.ngp-layout-standard.ngp-shape-square .ngp-card__image-wrap,
.ngp-layout-side.ngp-shape-square     .ngp-card__image-wrap {
    aspect-ratio: 1 / 1;
}
/* Circle */
.ngp-layout-standard.ngp-shape-circle .ngp-card__image-wrap,
.ngp-layout-side.ngp-shape-circle     .ngp-card__image-wrap {
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    margin: 16px auto;
    width: calc(100% - 32px);
    overflow: hidden;
}
/* When image_height is set (standard + overlay), aspect-ratio is overridden by height */
.ngp-layout-standard .ngp-card__image-wrap[style*="height"],
.ngp-layout-overlay  .ngp-card__image-wrap[style*="height"] {
    aspect-ratio: unset;
}

/* ================================================================
   LAYOUT: STANDARD (default)
   ================================================================ */
.ngp-layout-standard { flex-direction: column; }
.ngp-layout-standard .ngp-card__image-wrap { width: 100%; }

/* ================================================================
   LAYOUT: OVERLAY — content sits on top of image
   ================================================================ */
.ngp-layout-overlay { position: relative; }
.ngp-layout-overlay .ngp-card__image-wrap {
    width: 100%;
    display: block;
}
.ngp-layout-overlay .ngp-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* The text overlay */
.ngp-card__overlay-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 22px 20px;
    background: linear-gradient(to top, rgba(0,0,0,.72) 60%, transparent);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}
.ngp-layout-overlay .ngp-card__title { margin: 0; }
.ngp-layout-overlay .ngp-card__title a { color: #fff; }
.ngp-layout-overlay .ngp-card__title a:hover { color: rgba(255,255,255,.8); }
.ngp-layout-overlay .ngp-card__meta { color: rgba(255,255,255,.75); }
.ngp-layout-overlay .ngp-card__excerpt { color: rgba(255,255,255,.85); font-size: .88rem; }
.ngp-layout-overlay .ngp-card__read-more { color: #fff; }

/* ================================================================
   LAYOUT: SEPARATE — image block + detached content box
   ================================================================ */
.ngp-layout-separate {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* default — overridden by Elementor control */
    gap: 0;
    transition: transform .25s ease;
}
.ngp-layout-separate:hover {
    transform: translateY(-3px);
    box-shadow: none;
}
.ngp-layout-separate .ngp-card__image-wrap {
    width: 100%;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    display: block;
    position: relative;
    transition: border-radius .25s ease, box-shadow .25s ease;
}
.ngp-layout-separate .ngp-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.ngp-layout-separate .ngp-card__sep-body {
    background: #fff;
    border-radius: 0 0 12px 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    transition: background-color .25s ease, box-shadow .25s ease,
                border-color .25s ease, border-radius .25s ease;
}
.ngp-layout-separate .ngp-card__sep-body .ngp-card__title a {
    transition: color .2s ease;
}
.ngp-layout-separate .ngp-card__sep-body .ngp-card__meta,
.ngp-layout-separate .ngp-card__sep-body .ngp-card__excerpt {
    transition: color .2s ease;
}
/* Read More in separate box — always visible, full transition */
.ngp-layout-separate .ngp-card__read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--ngp-accent, #1a73e8);
    margin-top: auto;
    padding-top: 12px;
    transition: color .2s ease, background-color .2s ease,
                border-color .2s ease, gap .2s ease;
}
.ngp-layout-separate .ngp-card__read-more:hover {
    gap: 9px;
    text-decoration: underline;
}
.ngp-layout-separate .ngp-card__cat-badge {
    z-index: 3;
}


.ngp-layout-side {
    flex-direction: row;
    align-items: stretch;
}
.ngp-layout-side .ngp-card__image-wrap {
    width: 40%;
    flex-shrink: 0;
    min-height: 160px;
    height: auto !important; /* override inline style */
    aspect-ratio: unset;
}
.ngp-layout-side .ngp-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0; left: 0;
}
/* need relative wrapper for absolute img */
.ngp-layout-side .ngp-card__image-wrap { position: relative; }
.ngp-layout-side .ngp-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
}
/* Circle shape has no meaning in side layout — keep square */
.ngp-layout-side.ngp-shape-circle .ngp-card__image-wrap {
    border-radius: 0;
    margin: 0;
    width: 40%;
}

/* ================================================================
   CARD BODY
   ================================================================ */
.ngp-card__body {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ================================================================
   CARD ELEMENTS
   ================================================================ */
/* Category badge */
.ngp-card__cat-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--ngp-accent, #1a73e8);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 3;
    pointer-events: none;
}

/* Title */
.ngp-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.45;
    margin: 0 0 10px;
    color: #1a202c;
}
.ngp-card__title a {
    text-decoration: none;
    color: inherit;
    transition: color .2s;
}
.ngp-card__title a:hover { color: var(--ngp-accent, #1a73e8); }

/* Meta */
.ngp-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: .8rem;
    color: #718096;
    margin-bottom: 12px;
    align-items: center;
    justify-content: flex-start; /* overridden by Elementor meta_align control */
}
.ngp-meta-date, .ngp-meta-comments, .ngp-meta-author {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.ngp-meta-date i,
.ngp-meta-date svg,
.ngp-meta-comments i,
.ngp-meta-comments svg,
.ngp-meta-author i,
.ngp-meta-author svg {
    font-size: 13px;
    width: 13px;
    height: auto;
    flex-shrink: 0;
    color: inherit;
    fill: currentColor;
}

/* Excerpt */
.ngp-card__excerpt {
    font-size: .9rem;
    color: #4a5568;
    line-height: 1.65;
    margin: 0 0 14px;
    flex: 1;
}

/* Read more */
.ngp-card__read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--ngp-accent, #1a73e8);
    transition: gap .2s;
    margin-top: auto;
}
.ngp-card__read-more:hover { gap: 9px; text-decoration: underline; }

/* No posts */
.ngp-no-posts { text-align: center; padding: 48px; color: #718096; font-size: 1rem; }

/* ================================================================
   PAGINATION
   ================================================================ */
.ngp-pagination {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

/* All page buttons (numbers + prev/next arrows) */
.ngp-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: .88rem;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: background .18s, color .18s, border-color .18s, opacity .18s;
    font-family: inherit;
    line-height: 1;
}
.ngp-page-btn:hover:not(.ngp-disabled):not(.ngp-current) {
    background: var(--ngp-accent, #1a73e8);
    border-color: var(--ngp-accent, #1a73e8);
    color: #fff;
}
.ngp-page-btn:hover:not(.ngp-disabled):not(.ngp-current) svg {
    stroke: #fff;
}

/* Current / active page */
.ngp-page-btn.ngp-current {
    background: var(--ngp-accent, #1a73e8);
    border-color: var(--ngp-accent, #1a73e8);
    color: #fff;
    font-weight: 700;
    cursor: default;
    pointer-events: none;
}

/* Disabled prev/next arrows */
.ngp-page-btn.ngp-disabled,
.ngp-page-btn[disabled] {
    opacity: .35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Prev / Next arrow buttons — square, no min-width text padding */
.ngp-page-btn.ngp-prev,
.ngp-page-btn.ngp-next {
    min-width: 38px;
    padding: 0;
}
.ngp-page-btn svg {
    display: block;
    stroke: currentColor;
    flex-shrink: 0;
}

/* Ellipsis dots */
.ngp-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 38px;
    color: #a0aec0;
    font-size: .9rem;
    cursor: default;
    user-select: none;
}

/* Prev/Next mode: page indicator text */
.ngp-page-indicator {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 14px;
    font-size: .88rem;
    color: #4a5568;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    gap: 4px;
}
.ngp-page-indicator strong {
    color: var(--ngp-accent, #1a73e8);
    font-weight: 700;
}

/* Load More */
.ngp-load-more {
    display: inline-block;
    padding: 13px 36px;
    background: var(--ngp-accent, #1a73e8);
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: opacity .2s, transform .2s;
}
.ngp-load-more:hover { opacity: .88; transform: translateY(-1px); }
.ngp-load-more:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Infinite scroll */
.ngp-infinite-sentinel { text-align: center; padding: 24px; color: #718096; }
.ngp-loading { display: none; }
.ngp-loading.visible { display: block; }

/* Spinner */
.ngp-spinner {
    display: flex;
    justify-content: center;
    padding: 32px;
    grid-column: 1 / -1;
}
.ngp-spinner::after {
    content: '';
    width: 36px; height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--ngp-accent, #1a73e8);
    border-radius: 50%;
    animation: ngp-spin .7s linear infinite;
}
@keyframes ngp-spin { to { transform: rotate(360deg); } }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
    .ngp-grid { grid-template-columns: repeat(2,1fr) !important; }
}
@media (max-width: 640px) {
    .ngp-grid { grid-template-columns: 1fr !important; }
    .ngp-section-title { font-size: 1.5rem; }
    .ngp-layout-side { flex-direction: column; }
    .ngp-layout-side .ngp-card__image-wrap { width: 100% !important; min-height: 200px; }
}