/* Himkatha Resources Grid */
.himkatha-resources-grid {
    display: grid;
    grid-template-columns: repeat(var(--himkatha-columns-desktop, 3), minmax(0, 1fr));
    gap: 48px 28px;
}

.himkatha-resource-card {
    min-width: 0;
}

.himkatha-resource-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    margin-bottom: 20px;
    background: var(--wp--preset--color--primary-6);
    border-radius: 10px;
}

.himkatha-resource-media img {
    display: block;
    width: calc(100% - 6rem);
    height: auto;
    margin: 0 auto;
}

.himkatha-resource-file-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 14px;
    letter-spacing: .08em;
}

.himkatha-resource-content {
    text-align: left;
}

.himkatha-resources-align-center .himkatha-resource-content {
    text-align: center;
}

.himkatha-resource-meta {
    margin-bottom: 8px;
	font-family:Geist;
    font-size: 12px;
    line-height: 1.3;
    letter-spacing: .08em;
	opacity:0.7;
    text-transform: uppercase;
}

.himkatha-resource-title {
    margin: 0 0 10px;
    font-size: 24px;
    line-height: 1.15;
}

.himkatha-resource-description {
font-size: 15px;
line-height: 1.5;
font-family: Geist;
margin-bottom: 10px;
	margin-top:10px;
}

.himkatha-resource-description p {
    margin: 0;
}

.himkatha-resource-details {
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.4;
    opacity: .7;
}

.himkatha-resource-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.himkatha-resources-align-center .himkatha-resource-actions {
    justify-content: center;
}

.himkatha-resource-action {
    appearance: none;
    border: none;
    padding: 8px;
    margin: 0;
    background: var(--wp--preset--color--primary-3);
    color: #fff;
    font-family: Geist;
    font-size: 12px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    border-radius: 5px;
	transition:.2s ease;
}

.himkatha-resource-action:hover {background: var(--wp--preset--color--primary-4);color:#fff!important;}
/*
 * Keep the Resource viewer above theme headers, sticky navigation,
 * admin/toolbars, and other positioned elements.
 */
body .himkatha-resource-viewer {
    z-index: 2147483647 !important;
}

.himkatha-resource-viewer[hidden] {
    display: none !important;
}

.himkatha-resource-viewer {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.himkatha-resource-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 15, .88);
    cursor: pointer;
}

.himkatha-resource-viewer-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(1180px, 100%);
    height: min(92vh, 960px);
    overflow: hidden;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 24px 80px rgba(0,0,0,.4);
}

.himkatha-resource-viewer-title {
    flex: 0 0 auto;
    min-height: 58px;
    display: flex;
    align-items: center;
    padding: 14px 72px 14px 24px;
    border-bottom: 1px solid rgba(0,0,0,.10);
    background: #fff;
    color: #111;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 500;
}

.himkatha-resource-viewer-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 50%;
    background: #fff;
    color: #111;
    font-family: Arial, sans-serif;
    font-size: 27px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,.12);
    appearance: none;
}

.himkatha-resource-viewer-close span {
    display: block;
    transform: translateY(-1px);
}

.himkatha-resource-viewer-close:hover,
.himkatha-resource-viewer-close:focus {
    background: #111;
    color: #fff;
    border-color: #111;
    outline: none;
}

.himkatha-resource-viewer-content {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #e9e9e9;
}

.himkatha-resource-viewer-content iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: 0;
    background: #fff;
}

.himkatha-resource-viewer-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

body.himkatha-resource-viewer-open {
    overflow: hidden;
}

@media (max-width: 1199px) {
    .himkatha-resources-grid {
        grid-template-columns: repeat(var(--himkatha-columns-laptop, 3), minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .himkatha-resources-grid {
        grid-template-columns: repeat(var(--himkatha-columns-tablet, 2), minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .himkatha-resources-grid {
        grid-template-columns: repeat(var(--himkatha-columns-mobile, 1), minmax(0, 1fr));
        gap: 38px;
    }

    .himkatha-resource-title {
        font-size: 22px;
    }

    .himkatha-resource-viewer {
        padding: 0;
    }

    .himkatha-resource-viewer-dialog {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .himkatha-resource-viewer-title {
        min-height: 54px;
        padding: 12px 62px 12px 16px;
        font-size: 14px;
    }

    .himkatha-resource-viewer-close {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
    }

    .himkatha-resource-viewer-content iframe {
        min-height: 0;
    }
}


/*
 * Viewer must occupy the complete viewport.
 * Some themes apply top offsets/transforms to fixed overlays globally.
 */
html body .himkatha-resource-viewer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 32px !important;
    transform: none !important;
    inset: 0 !important;
    z-index: 2147483647 !important;
}

html body .himkatha-resource-viewer[hidden] {
    display: none !important;
}

html body .himkatha-resource-viewer-backdrop {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

html body > #himkatha-resource-viewer {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    z-index: 2147483647 !important;
}

/* Font Awesome icons for Resource action buttons */
.himkatha-resource-button .himkatha-fa-icon {
    display: inline-block;
    margin-left: .45em;
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
    font-weight: 900;
    line-height: 1;
}


/* Resource button Font Awesome icons */
.himkatha-resource-button.himkatha-icon-read::after,
.himkatha-resource-button.himkatha-icon-download::after,
.himkatha-resource-button.himkatha-icon-buy::after {
    display: inline-block;
    margin-left: 0.5em;
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
    font-style: normal;
    font-variant: normal;
    font-weight: 900 !important;
    line-height: 1;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

/* Resource action icons — Font Awesome codepoints requested for Himkatha */
.himkatha-resource-action .himkatha-resource-fa-icon {
    display: inline-block !important;
    width: auto !important;
    margin-left: .45em !important;
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome !important;
    font-style: normal !important;
    font-variant: normal !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    speak: none;
}

.himkatha-resource-read .himkatha-resource-fa-icon::before {
    content: "\f002" !important;
}

.resource-button-download .himkatha-resource-fa-icon::before {
    content: "\f019" !important;
}

.resource-button-buy .himkatha-resource-fa-icon::before {
    content: "\f54f" !important;
}
.resource-button-download .himkatha-resource-fa-icon, .resource-button-buy .himkatha-resource-fa-icon {
	margin-left:0!important;
}


/* Resource Type filter */
.himkatha-resources-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.himkatha-resources-filter >.himkatha-resource-filter {
    appearance: none;
    border: 0;
    padding: 1.2rem!important;
	text-align:center;
    margin: 0;
    background: var(--wp--preset--color--primary-6, #f7f3ed);
	color: var(--wp--preset--color--primary-4, #222);
    font-family: Geist;
    font-size: 16px;
	border-radius:10px;
	font-weight:500;
    line-height: 1.15;
    text-decoration: none;
    cursor: pointer;
    transition: .2s ease;
}

.himkatha-resource-filter:hover,
.himkatha-resource-filter:focus,
.himkatha-resource-filter.is-active {
    transform: translateY(-3px);
}

.himkatha-resource-filter.is-active{
    background: var(--wp--preset--color--primary-4, #222);
    color: var(--wp--preset--color--primary-6, #f7f3ed);
}

.himkatha-resource-filter:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 5px;
}

.himkatha-resource-card.is-filtered-out {
    display: none;
}

.himkatha-resource-card[hidden] {
    display: none !important;
}

@media (max-width: 767px) {
    .himkatha-resources-filter {
        gap: 10px 18px;
        margin-bottom: 28px;
    }
}

@media (max-width: 767px) {
    .himkatha-resources-pagination {
        margin-top: 42px;
    }
}

/* Resources pagination — shared visual language with the Blog Grid */
.hkbg-pagination-wrap {
    width: 100%;
    margin-top: 56px;
}

.hkbg-pagination {
    display: flex;
    justify-content: center;
    margin: 48px 0 10px;
	width: 100%;
}

.hkbg-pagination-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hkbg-page-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    padding: 0 16px;
    border: 0;
    border-radius: 20px;
    background: #f4eee7;
    color: #4d9695;
    font: inherit;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: transform .2s ease, background-color .2s ease, color .2s ease;
}

.hkbg-pagination > .hkbg-pagination-inner > .hkbg-page-button {
    font-family: Geist;
    color: var(--wp--preset--color--primary-3)!important;
    background-color: var(--wp--preset--color--primary-6)!important;
    font-size: 16px;
    font-weight: 500;
    border: none!important;
    min-width: 38px;
    height: 38px;
    width: -webkit-fit-content;
	padding: 0 10px!important;
}

.hkbg-page-button:hover {
    transform: translateY(-1px);
}

.hkbg-pagination > .hkbg-pagination-inner > .hkbg-page-button.is-active {
    background-color: var(--wp--preset--color--primary-3)!important;
    color: var(--wp--preset--color--primary-6)!important;
}

.hkbg-page-next {
    width: auto;
    min-width: 126px;
    border-radius: 999px;
}

.hkbg-page-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

@media (max-width: 767px) {
    .hkbg-pagination-wrap {
        margin-top: 42px;
    }

    .hkbg-pagination-inner {
        gap: 10px;
    }

    .hkbg-page-button {
        width: 54px;
        height: 54px;
        font-size: 22px;
    }

    .hkbg-page-next {
        min-width: 94px;
    }
}

/* Resource pagination uses the same visual language as Blog Grid pagination. */
.hkbg-resource-pagination-wrap .hkbg-page-button {
    /* Intentionally empty: inherits the shared hkbg-page-button styling. */
}
