/* ============================================================
   SDW Free Resources — Frontend CSS  v2
   Premium card design with featured image + modal image hero
   ============================================================ */

/* ── Section wrapper ── */
.sdw-res-section { padding: 25px 130px;width: 100%; }

.sdw-res-section-header { margin-bottom: 28px; }
.sdw-res-tag {
    display: inline-block;
    font-size: 12px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: #2E9E5B; background: #E6F7EE;
    padding: 5px 14px; border-radius: 20px; margin-bottom: 12px;
}
.sdw-res-title { font-size: clamp(24px,3vw,36px); font-weight: 900; margin: 0 0 8px; color: #1C1A16; }
.sdw-res-sub   { font-size: 16px; color: #4A4035; max-width: 520px; }

/* ── Grid ── */
.sdw-res-grid { display: grid; gap: 16px; align-items: stretch; }
.sdw-res-cols-1 { grid-template-columns: 1fr; }
.sdw-res-cols-2 { grid-template-columns: repeat(2, 1fr); }
.sdw-res-cols-3 { grid-template-columns: repeat(3, 1fr); }
.sdw-res-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ══════════════════════════════════════════════════════
   CARD BASE
══════════════════════════════════════════════════════ */
.sdw-res-card {
    background: white;
    border: 1.5px solid rgba(107,76,42,0.11);
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    user-select: none;
    outline: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.sdw-res-card:hover {
    border-color: #2E9E5B;
    box-shadow: 0 12px 40px rgba(46,158,91,0.16);
    transform: translateY(-4px);
}
.sdw-res-card:focus-visible {
    outline: 3px solid #2E9E5B;
    outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════
   PREMIUM CARD — has featured image
   Tall cover-image style with gradient overlay
══════════════════════════════════════════════════════ */
.sdw-res-card--has-image {
    padding: 0;
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(28,26,22,0.10);
}
.sdw-res-card--has-image:hover {
    border-color: transparent;
    box-shadow: 0 16px 48px rgba(28,26,22,0.18);
}

/* Cover image container */
.sdw-res-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #E6F7EE, #E3F4FD);
}
.sdw-res-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}
.sdw-res-card--has-image:hover .sdw-res-cover-img {
    transform: scale(1.05);
}

/* Gradient overlay on image */
.sdw-res-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 30%,
        rgba(28,26,22,0.55) 100%
    );
    display: flex;
    align-items: flex-end;
    padding: 14px 16px;
}
.sdw-res-cover-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: white;
    background: rgba(46,158,91,0.85);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 20px;
}

/* FREE badge — top right corner */
.sdw-res-cover-badge {
    position: absolute;
    top: 12px; right: 12px;
    background: linear-gradient(135deg, #FF9B21, #FF6B35);
    color: white;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(255,155,33,0.45);
}

/* Card body beneath the image */
.sdw-res-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}
.sdw-res-card--has-image .sdw-res-card-title {
    font-weight: 800;
    font-size: 15px;
    color: #1C1A16;
    line-height: 1.3;
    margin: 0;
}
.sdw-res-card--has-image .sdw-res-card-desc {
    font-size: 13px;
    color: #8A7B6A;
    line-height: 1.5;
    margin: 0;
    flex: 1;
}
.sdw-res-card--has-image .sdw-res-dl-btn {
    align-self: flex-start;
    margin-top: 4px;
}

/* ══════════════════════════════════════════════════════
   STANDARD CARD — emoji/icon style (no featured image)
══════════════════════════════════════════════════════ */
.sdw-res-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    flex: 1;
}
.sdw-res-icon-wrap {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, #E6F7EE, #E3F4FD);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(46,158,91,0.12);
}
.sdw-res-icon-wrap img { width: 32px; height: 32px; object-fit: contain; }
.sdw-res-emoji { font-size: 24px; line-height: 1; }

.sdw-res-card-content { flex: 1; min-width: 0; }
.sdw-res-card-tag {
    display: inline-block;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.07em;
    color: #2E9E5B; margin-bottom: 5px;
}
.sdw-res-card-title {
    font-weight: 700; font-size: 15px;
    color: #1C1A16; margin-bottom: 5px; line-height: 1.3;
}
.sdw-res-card-desc {
    font-size: 13px; color: #8A7B6A;
    line-height: 1.5; margin-bottom: 10px;
}

/* ── Download button (shared) ── */
.sdw-res-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px; font-weight: 700;
    color: #2E9E5B;
    background: #E6F7EE;
    padding: 7px 14px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.sdw-res-card:hover .sdw-res-dl-btn {
    background: #2E9E5B;
    color: white;
    box-shadow: 0 4px 12px rgba(46,158,91,0.3);
}

/* ══════════════════════════════════════════════════════
   MODAL OVERLAY
══════════════════════════════════════════════════════ */
.sdw-res-modal-overlay {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.sdw-res-modal-overlay[hidden] { display: none !important; }

.sdw-res-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(28,26,22,0.65);
    backdrop-filter: blur(8px);
    animation: sdwResBackdrop 0.25s ease;
}
@keyframes sdwResBackdrop {
    from { opacity: 0; } to { opacity: 1; }
}

.sdw-res-modal-box {
    position: relative; z-index: 1;
    background: white;
    border-radius: 22px;
    width: 100%; max-width: 500px;
    max-height: 94vh;
    overflow-y: auto;
    box-shadow: 0 28px 90px rgba(28,26,22,0.28);
    animation: sdwResSlideUp 0.32s cubic-bezier(0.34,1.1,0.64,1) both;
    scrollbar-width: thin;
    scrollbar-color: #E0D8D0 transparent;
}
@keyframes sdwResSlideUp {
    from { opacity: 0; transform: scale(0.93) translateY(28px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.sdw-res-modal-box.sdw-res-closing {
    animation: sdwResSlideDown 0.22s ease forwards;
}
@keyframes sdwResSlideDown {
    from { opacity: 1; transform: scale(1)    translateY(0); }
    to   { opacity: 0; transform: scale(0.93) translateY(18px); }
}

/* Close button */
.sdw-res-modal-close {
    position: absolute; top: 12px; right: 12px;
    width: 34px; height: 34px;
    background: rgba(255,255,255,0.95);
    border: none; border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 20;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    color: #4A4035;
}
.sdw-res-modal-close:hover { background: #FF5A5A; color: white; transform: scale(1.1); }

/* ── MODAL: FEATURED IMAGE HERO ── */
.sdw-res-modal-img-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    border-radius: 22px 22px 0 0;
    flex-shrink: 0;
}
.sdw-res-modal-hero-img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: center;
    display: block;
}
/* Dark gradient overlay on image hero */
.sdw-res-modal-img-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(28,26,22,0.05) 0%,
        rgba(28,26,22,0.65) 100%
    );
    display: flex; flex-direction: column;
    justify-content: flex-end;
    padding: 20px 24px;
}
.sdw-res-modal-img-badge {
    display: inline-block;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: white;
    background: rgba(46,158,91,0.9);
    backdrop-filter: blur(4px);
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
    align-self: flex-start;
}
.sdw-res-modal-img-title {
    font-size: 22px; font-weight: 900;
    color: white; margin: 0; line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ── MODAL: EMOJI HERO (no image) ── */
.sdw-res-modal-hero {
    background: linear-gradient(135deg, #E6F7EE 0%, #E3F4FD 100%);
    padding: 28px 28px 22px;
    display: flex; align-items: center; gap: 14px;
    border-radius: 22px 22px 0 0;
}
.sdw-res-modal-icon {
    width: 58px; height: 58px;
    background: white; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 16px rgba(46,158,91,0.18);
    flex-shrink: 0;
}
.sdw-res-modal-pretitle {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: #2E9E5B; margin-bottom: 5px;
}
.sdw-res-modal-title {
    font-size: 21px; font-weight: 900;
    color: #1C1A16; margin: 0; line-height: 1.2;
}

/* ── Benefits ── */
.sdw-res-modal-benefits { padding: 16px 26px 0; }
.sdw-res-benefit {
    display: flex; align-items: center; gap: 10px;
    font-size: 14px; color: #4A4035;
    padding: 5px 0;
}
.sdw-res-benefit-check {
    width: 22px; height: 22px;
    background: linear-gradient(135deg, #2E9E5B, #1A8FD1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 11px; font-weight: 700;
    flex-shrink: 0;
}

/* ── Form area ── */
.sdw-res-modal-form-wrap { padding: 18px 26px 6px; }
.sdw-res-modal-sub {
    font-size: 14px; color: #4A4035;
    margin: 0 0 16px; line-height: 1.5;
}
.sdw-res-form-row {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 12px; margin-bottom: 12px;
}
.sdw-res-field-group label {
    display: block; font-size: 12px; font-weight: 700;
    color: #4A4035; margin-bottom: 5px; letter-spacing: 0.02em;
}
.sdw-req { color: #FF5A5A; }
.sdw-res-field-group input {
    width: 100%; padding: 12px 14px;
    border: 1.5px solid rgba(107,76,42,0.18);
    border-radius: 10px; font-size: 15px; font-family: inherit;
    color: #1C1A16; background: white; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.sdw-res-field-group input:focus {
    border-color: #2E9E5B;
    box-shadow: 0 0 0 3px rgba(46,158,91,0.12);
}

/* ── Submit button ── */
.sdw-res-submit-btn {
    width: 100%; margin-top: 4px; padding: 15px;
    background: linear-gradient(135deg, #2E9E5B, #1A8FD1);
    color: white; border: none; border-radius: 50px;
    font-size: 16px; font-weight: 700; font-family: inherit;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 6px 20px rgba(46,158,91,0.32);
    letter-spacing: 0.01em;
}
.sdw-res-submit-btn:hover   { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 8px 28px rgba(46,158,91,0.40); }
.sdw-res-submit-btn:active  { transform: translateY(0); }
.sdw-res-submit-btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

/* ── GDPR note ── */
.sdw-res-gdpr {
    font-size: 12px; color: #8A7B6A;
    text-align: center; margin: 10px 0 0; line-height: 1.5;
}

/* ── Fluent form ── */
.sdw-res-ff-loading { text-align: center; padding: 32px; color: #8A7B6A; font-size: 14px; }

/* ── Success ── */
.sdw-res-success-box { text-align: center; padding: 28px 16px 8px; }
.sdw-res-success-icon { font-size: 52px; margin-bottom: 10px; }
.sdw-res-success-msg  { font-size: 17px; font-weight: 800; color: #2E9E5B; line-height: 1.5; }
.sdw-res-dl-direct {
    display: inline-block; margin-top: 16px;
    background: linear-gradient(135deg, #2E9E5B, #1A8FD1);
    color: white; text-decoration: none; font-weight: 700;
    padding: 13px 28px; border-radius: 50px; font-size: 15px;
    box-shadow: 0 4px 16px rgba(46,158,91,0.3);
}

/* ── Error ── */
.sdw-res-error-box {
    background: #FFF0F0; border: 1.5px solid #FF5A5A;
    border-radius: 8px; padding: 10px 14px;
    font-size: 13px; color: #C0392B; margin-top: 10px;
}

/* ── Trust bar ── */
.sdw-res-modal-trust {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; padding: 14px 26px 22px;
    font-size: 12px; color: #8A7B6A; flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .sdw-res-cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .sdw-res-cols-3,
    .sdw-res-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .sdw-res-modal-img-title { font-size: 19px; }
}
@media (max-width: 520px) {
    .sdw-res-cols-2,
    .sdw-res-cols-3,
    .sdw-res-cols-4 { grid-template-columns: 1fr; }
    .sdw-res-form-row { grid-template-columns: 1fr; }
    .sdw-res-modal-box { border-radius: 18px; }
    .sdw-res-modal-img-hero { border-radius: 18px 18px 0 0; }
}
