/* ─── Articles Widget for Elementor ─────────────────────────────────────── */

/* Base */
.awe-widget {
    --awe-cols: 3;
    font-family: inherit;
}

.awe-no-posts {
    color: #999;
    font-style: italic;
}

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

/* ─── Hero Grid ───────────────────────────────────────────────────────────── */
/* Hero card: full-width row, image on the right, text on the left */
.awe-hero-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* The hero card itself */
.awe-card--hero {
    align-items: center;
    overflow: hidden;
}

/* In hero mode the link-wrap fills the grid cell normally */
.awe-card--hero > .awe-card__link-wrap,
.awe-card--hero > .awe-card__hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    text-decoration: none;
    color: inherit;
    height: 100%;
    width: 100%;
}

/* Hero image — right column. Height controlled by Elementor slider (default 480px) */
.awe-card--hero .awe-card__img {
    order: 2;
    padding-top: 0;       /* override aspect-ratio trick; height is set directly */
    height: 480px;        /* fallback; overridden by Elementor selector */
    min-height: unset;
    width: 100%;          /* fills its grid cell */
}

/* Hero body — left column */
.awe-card--hero .awe-card__body {
    order: 1;
    display: flex;
    flex-direction: column;
    padding: 40px 48px 40px 0;
    justify-content: center; /* overridden by vertical-align control */
}

/* Sub-grid: equal columns for remaining cards */
.awe-hero-sub {
    display: grid;
    grid-template-columns: repeat(var(--awe-cols, 3), 1fr);
    gap: 20px;
    align-content: start;
}

/* ─── Card ────────────────────────────────────────────────────────────────── */
.awe-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
}

/* Make whole-card link fill the card */
.awe-card__link-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.awe-card__link-wrap:hover .awe-card__title {
    text-decoration: underline;
}

/* Image */
.awe-card__img {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 66.66%; /* 3:2 default */
    background: #eee;
}

.awe-card__img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.awe-card:hover .awe-card__img img {
    transform: scale(1.04);
}

.awe-card__img-placeholder {
    position: absolute;
    inset: 0;
    background: #e8e8e8;
}

/* Body */
.awe-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 0;
}

/* Category */
.awe-card__cat {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
    color: #111;
}

/* Title */
.awe-card__title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    line-height: 1.3;
    font-weight: 600;
    color: #111;
}

.awe-card__title a {
    color: inherit;
    text-decoration: none;
}

.awe-card__title a:hover {
    text-decoration: underline;
}

/* Excerpt */
.awe-card__excerpt {
    margin: 0 0 12px;
    font-size: 0.88rem;
    line-height: 1.6;
    color: #555;
    flex: 1;
}

/* Meta */
.awe-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: #999;
    margin-top: auto;
}

.awe-card__meta span + span::before {
    content: '·';
    margin-right: 8px;
}

/* Title row: title + arrow side by side */
.awe-card__title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.awe-card__title-row .awe-card__title {
    margin: 0;
    flex: 1;
}

/* Arrow button */
.awe-card__arrow-wrap {
    flex-shrink: 0;
    margin-top: 2px; /* optical alignment with first line of title */
}

.awe-card__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.awe-card:hover .awe-card__arrow {
    transform: translateX(4px);
}

/* ─── Slider ──────────────────────────────────────────────────────────────── */
.awe-slider-wrap {
    position: relative;
}

.awe-slider {
    display: flex;
    overflow: hidden;
    gap: 0;
}

.awe-slider .awe-card {
    flex: 0 0 auto;
    /* width set by JS */
}

.awe-slider-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.awe-slider-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #111;
    border-radius: 50%;
    cursor: pointer;
    background: #fff;
    transition: background 0.2s, color 0.2s;
}

.awe-slider-btn:hover {
    background: #111;
    color: #fff;
}

.awe-slider-btn svg {
    pointer-events: none;
}

.awe-slider-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.awe-slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    border: none;
    padding: 0;
}

.awe-slider-dot.is-active {
    background: #111;
    transform: scale(1.3);
}

/* ─── Pagination ──────────────────────────────────────────────────────────── */
.awe-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 36px;
    justify-content: center;
}

.awe-pagination a,
.awe-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #111;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
}

.awe-pagination a:hover {
    background: #f5f5f5;
}

.awe-pagination .current {
    background: #111;
    color: #fff;
    border-color: #111;
}

.awe-pagination--loadmore {
    justify-content: center;
}

.awe-loadmore {
    display: inline-block;
    padding: 12px 36px;
    background: #111;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: opacity 0.2s;
}

.awe-loadmore:hover {
    opacity: 0.8;
}

.awe-loadmore:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .awe-grid {
        --awe-cols: 2;
    }
    .awe-hero-sub {
        grid-template-columns: repeat(2, 1fr);
    }
    .awe-card--hero .awe-card__body {
        padding: 28px 32px 28px 0;
    }
}

@media (max-width: 767px) {
    .awe-grid {
        --awe-cols: 1 !important;
    }
    .awe-hero-sub {
        grid-template-columns: 1fr;
    }

    /* Stack hero card vertically on mobile */
    .awe-card--hero > .awe-card__link-wrap,
    .awe-card--hero > .awe-card__hero-inner {
        grid-template-columns: 1fr;
    }
    .awe-card--hero .awe-card__img {
        order: 1;
        min-height: 0;
        padding-top: 56.25%;
    }
    .awe-card--hero .awe-card__body {
        order: 2;
        padding: 16px 0;
    }
}

/* ─── Related Posts Widget ────────────────────────────────────────────────── */
.awe-related-widget {
    font-family: inherit;
}

.awe-related__heading {
    margin: 0 0 24px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #111;
}

.awe-related-grid {
    display: grid;
    grid-template-columns: repeat(var(--awe-cols, 3), 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .awe-related-grid {
        /* controlled by data-tab-cols via JS */
    }
}

@media (max-width: 767px) {
    .awe-related-grid {
        grid-template-columns: 1fr !important;
    }
}
