/* ==========================================================================
   Ahimsa Resources – Main Styles
   ========================================================================== */

:root {
    --ares-radius: 12px;
    --ares-shadow: 0 2px 8px rgba(0,0,0,.08);
    --ares-shadow-hover: 0 8px 24px rgba(0,0,0,.12);
    --ares-transition: .25s ease;
    --ares-gap: 28px;
    --ares-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    --ares-text: #1a1a2e;
    --ares-text-muted: #555;
    --ares-bg: #f8f9fa;
    --ares-card-bg: #ffffff;
    --ares-border: #e5e7eb;
}

.ares-container {
    width: 100%;
    max-width: min(1600px, 100%);
    margin: 0 auto;
    padding: 20px clamp(16px, 3vw, 40px) 60px;
    font-family: var(--ares-font);
    color: var(--ares-text);
    box-sizing: border-box;
}

/* ---------- Filter pills ---------- */

.ares-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
    justify-content: center;
}

.ares-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 2px solid var(--ares-border);
    border-radius: 999px;
    background: var(--ares-card-bg);
    color: var(--ares-text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--ares-transition);
    line-height: 1;
}

.ares-filter-pill:hover {
    border-color: var(--pill-color, var(--ares-text));
    color: var(--pill-color, var(--ares-text));
}

.ares-filter-pill.ares-pill-active {
    background: var(--pill-color, var(--ares-text));
    border-color: var(--pill-color, var(--ares-text));
    color: #fff;
}

.ares-pill-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.ares-pill-icon svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.ares-filter-pill.ares-pill-active .ares-pill-icon svg {
    stroke: #fff;
}

/* ---------- Card grid ---------- */

.ares-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ares-gap);
}

@media (min-width: 1280px) {
    .ares-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .ares-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .ares-grid { grid-template-columns: 1fr; }
}

/* ---------- Card ---------- */

.ares-card {
    background: var(--ares-card-bg);
    border-radius: var(--ares-radius);
    box-shadow: var(--ares-shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--ares-transition), box-shadow var(--ares-transition);
    display: flex;
    flex-direction: column;
}

.ares-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ares-shadow-hover);
}

.ares-card.ares-card-hidden {
    display: none;
}

/* Thumbnail */

.ares-card-thumb {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: var(--ares-bg);
    overflow: hidden;
}

.ares-container .ares-card-thumb img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-width: none;
}

.ares-card-thumb-placeholder {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ares-bg), #e2e8f0);
}
.ares-container .ares-card-thumb-placeholder svg {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    opacity: .3;
    stroke: var(--ares-text);
    flex-shrink: 0;
}
.ares-card-thumb-emoji {
    font-size: clamp(48px, 12vw, 72px);
    line-height: 1;
    user-select: none;
}

.ares-card-duration {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0,0,0,.75);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .02em;
    backdrop-filter: blur(4px);
}
.ares-card-duration svg {
    flex-shrink: 0;
    stroke: #fff;
}

.ares-card-type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ares-card-type-badge svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.ares-type-youtube { background: #ff0000; color: #fff; }
.ares-type-pdf { background: #dc2626; color: #fff; }
.ares-type-link { background: #4a5568; color: #fff; }
.ares-type-instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #fff;
}
.ares-type-list {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
}

/* Body */

.ares-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ares-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.ares-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 3px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--badge-color) 12%, transparent);
    color: var(--badge-color);
    line-height: 1;
}
.ares-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}
.ares-badge-icon svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.ares-card-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.3;
    color: var(--ares-text);
}

.ares-card-summary {
    font-size: 14px;
    color: var(--ares-text-muted);
    margin: 0;
    line-height: 1.5;
    flex: 1;
}

.ares-empty {
    text-align: center;
    color: var(--ares-text-muted);
    font-size: 16px;
    padding: 60px 20px;
}

/* ---------- Modal ---------- */

.ares-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0,0,0,.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}

.ares-modal-overlay[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.ares-modal {
    position: relative;
    background: var(--ares-card-bg);
    border-radius: var(--ares-radius);
    width: 100%;
    max-width: 760px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    transform: translateY(20px);
    transition: transform .3s;
}

.ares-modal-overlay[aria-hidden="false"] .ares-modal {
    transform: translateY(0);
}

.ares-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--ares-text-muted);
    z-index: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--ares-transition);
}
.ares-modal-close:hover {
    background: var(--ares-bg);
}

.ares-modal-content {
    padding: 32px 32px 16px;
    overflow-y: auto;
    flex: 1;
}

.ares-modal-content h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: var(--ares-text);
}

.ares-modal-content .ares-modal-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.ares-modal-content .ares-modal-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--ares-text);
}

.ares-modal-content .ares-modal-body p {
    margin: 0 0 12px;
}

.ares-modal-content .ares-embed-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}
.ares-modal-content .ares-embed-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.ares-pdf-wrap {
    width: 100%;
    height: 60vh;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--ares-border);
}
.ares-pdf-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.ares-btn-download {
    text-decoration: none;
    display: inline-flex;
}

.ares-modal-duration {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ares-text-muted);
    margin: 0 0 12px;
    padding: 4px 10px;
    background: var(--ares-bg);
    border-radius: 6px;
    line-height: 1;
}
.ares-modal-duration svg {
    flex-shrink: 0;
    stroke: var(--ares-text-muted);
}

.ares-modal-summary {
    font-size: 15px;
    line-height: 1.7;
    color: var(--ares-text-muted);
    margin: 0 0 20px;
}

.ares-list-resource {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    border: 1px solid var(--ares-border);
    border-radius: 10px;
    overflow: hidden;
}
.ares-list-resource-item {
    border-bottom: 1px solid var(--ares-border);
}
.ares-list-resource-item:last-child {
    border-bottom: none;
}
.ares-list-resource-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    text-decoration: none;
    color: var(--ares-text);
    transition: background var(--ares-transition);
}
.ares-list-resource-link:hover {
    background: var(--ares-bg);
}
.ares-list-resource-name {
    font-weight: 600;
    font-size: 15px;
}
.ares-list-resource-detail {
    font-size: 13px;
    color: var(--ares-text-muted);
    line-height: 1.45;
}
.ares-list-resource-link::after {
    content: "Instagram →";
    font-size: 11px;
    font-weight: 600;
    color: #a855f7;
    margin-top: 4px;
}

.ares-external-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--ares-text);
    color: #fff;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--ares-transition);
    margin: 8px 0 16px;
}
.ares-external-link-btn:hover {
    background: #333;
    color: #fff;
}
.ares-external-link-btn svg { flex-shrink: 0; }

.ares-modal-content .ares-links {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}
.ares-modal-content .ares-links li {
    margin-bottom: 8px;
}
.ares-modal-content .ares-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ares-text);
    font-weight: 500;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--ares-border);
    transition: all var(--ares-transition);
}
.ares-modal-content .ares-links a:hover {
    background: var(--ares-bg);
    border-color: #aaa;
}

/* Modal footer */

.ares-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 32px 24px;
    border-top: 1px solid var(--ares-border);
    flex-wrap: wrap;
}

.ares-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ares-transition);
    text-decoration: none;
    line-height: 1;
    border: none;
}
.ares-btn svg { flex-shrink: 0; }

.ares-btn-page {
    background: var(--ares-bg);
    color: var(--ares-text);
    border: 1px solid var(--ares-border);
}
.ares-btn-page:hover { background: #e9ecef; }

.ares-btn-print {
    background: var(--ares-text);
    color: #fff;
}
.ares-btn-print:hover { background: #333; }

/* ---------- Single resource page ---------- */

.ares-single {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 16px 60px;
    font-family: var(--ares-font);
    color: var(--ares-text);
}

.ares-single-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ares-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    transition: color var(--ares-transition);
}
.ares-single-back:hover { color: var(--ares-text); }

.ares-single h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.3;
}

.ares-single .ares-single-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
}

.ares-single-body {
    font-size: 16px;
    line-height: 1.8;
}
.ares-single-body p { margin: 0 0 16px; }

.ares-single .ares-embed-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}
.ares-single .ares-embed-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.ares-single .ares-links {
    list-style: none;
    padding: 0;
    margin: 24px 0;
}
.ares-single .ares-links li { margin-bottom: 8px; }
.ares-single .ares-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ares-text);
    font-weight: 500;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--ares-border);
    transition: all var(--ares-transition);
}
.ares-single .ares-links a:hover {
    background: var(--ares-bg);
}

.ares-single-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--ares-border);
    display: flex;
    gap: 12px;
}

/* ---------- Print preview overlay ---------- */

.ares-print-overlay {
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(0,0,0,.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ares-print-frame {
    background: #fff;
    width: 8.5in;
    min-height: 11in;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0.75in;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    position: relative;
    display: flex;
    flex-direction: column;
}


.ares-print-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 16px;
    line-height: 1.3;
    color: var(--ares-text);
}

.ares-print-body {
    font-size: 13px;
    line-height: 1.7;
    color: var(--ares-text);
    flex: 1;
}
.ares-print-body p { margin: 0 0 10px; }

.ares-print-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--ares-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ares-print-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 50%;
}

.ares-print-qr {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.ares-print-footer-text {
    text-align: right;
    font-size: 11px;
    color: var(--ares-text-muted);
    line-height: 1.4;
}
.ares-print-footer-text strong {
    display: block;
    font-size: 13px;
    color: var(--ares-text);
}

/* ---------- Responsive modal ---------- */

@media (max-width: 600px) {
    .ares-modal-overlay {
        padding: 16px;
        align-items: center;
        justify-content: center;
    }
    .ares-modal {
        max-height: min(92vh, 100%);
        border-radius: var(--ares-radius);
    }
    .ares-modal-content { padding: 24px 20px 12px; }
    .ares-modal-footer { padding: 12px 20px 20px; }
    .ares-modal-footer { flex-direction: column; }
    .ares-btn { justify-content: center; }
    .ares-filters { gap: 6px; }
    .ares-filter-pill { padding: 6px 12px; font-size: 13px; }
}

@media (max-width: 480px) {
    .ares-print-frame {
        width: 100%;
        min-height: auto;
        padding: 0.5in;
    }
}
