/* Layanan Madrasah — master hub */
.layanan-page {
    background: linear-gradient(180deg, #eef4ff 0%, #f8fafc 320px, #fff 100%);
}

.layanan-hero {
    position: relative;
    padding: 36px 0 10px;
    overflow: hidden;
}
.layanan-hero-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.layanan-hero-orbs span {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .45;
    animation: layananOrb 12s ease-in-out infinite alternate;
}
.layanan-hero-orbs span:nth-child(1) {
    width: 280px; height: 280px;
    background: var(--theme-secondary, #307ad5);
    top: -80px; left: -40px;
}
.layanan-hero-orbs span:nth-child(2) {
    width: 220px; height: 220px;
    background: var(--theme-primary, #00a651);
    top: 20px; right: 5%;
    animation-delay: -4s;
}
.layanan-hero-orbs span:nth-child(3) {
    width: 160px; height: 160px;
    background: #7c4dff;
    bottom: -40px; left: 35%;
    animation-delay: -7s;
}
@keyframes layananOrb {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(20px, -15px) scale(1.08); }
}

.layanan-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 28px;
    align-items: center;
}
.layanan-hero-text h2 {
    font-size: clamp(22px, 3vw, 32px);
    color: #1a2d4d;
    margin: 0 0 10px;
    line-height: 1.3;
}
.layanan-hero-text p {
    color: #5a6b88;
    font-size: 15px;
    line-height: 1.7;
    margin: 0;
    max-width: 560px;
}
.layanan-hero-stats {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.layanan-stat-pill {
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(48,122,213,.15);
    border-radius: 14px;
    padding: 14px 20px;
    min-width: 100px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(48,80,150,.08);
}
.layanan-stat-pill strong {
    display: block;
    font-size: 26px;
    line-height: 1;
    color: var(--theme-secondary, #307ad5);
}
.layanan-stat-pill span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #7a8aa8;
    font-weight: 600;
}

.layanan-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin: 32px 0 28px;
    padding: 18px 22px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e4eaf8;
    box-shadow: 0 6px 24px rgba(48,80,150,.06);
}
.layanan-search {
    flex: 1;
    min-width: 220px;
    max-width: 380px;
    position: relative;
}
.layanan-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa8c4;
}
.layanan-search input {
    width: 100%;
    border: 1px solid #dde5f5;
    border-radius: 999px;
    padding: 10px 16px 10px 40px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.layanan-search input:focus {
    border-color: var(--theme-secondary, #307ad5);
    box-shadow: 0 0 0 3px rgba(48,122,213,.12);
}
.layanan-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.layanan-filter-btn {
    border: 1px solid #dde5f5;
    background: #f8faff;
    color: #4a5a78;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s;
}
.layanan-filter-btn:hover,
.layanan-filter-btn.active {
    background: var(--theme-secondary, #307ad5);
    border-color: var(--theme-secondary, #307ad5);
    color: #fff;
}

.layanan-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e2d4d;
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.layanan-section-title i { color: var(--theme-primary, #00a651); }

/* Bento featured */
.layanan-bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}
.layanan-bento-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-decoration: none;
    color: #fff;
    box-shadow: 0 16px 40px rgba(20,40,80,.18);
    transition: transform .3s, box-shadow .3s;
}
.layanan-bento-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 50px rgba(20,40,80,.25);
    color: #fff;
}
.layanan-bento-card:nth-child(1) { grid-column: span 7; min-height: 260px; }
.layanan-bento-card:nth-child(2) { grid-column: span 5; }
.layanan-bento-card:nth-child(3) { grid-column: span 5; }
.layanan-bento-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform .5s;
}
.layanan-bento-card:hover .layanan-bento-bg { transform: scale(1.06); }
.layanan-bento-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 20%, rgba(10,20,40,.88) 100%);
}
.layanan-bento-body {
    position: relative;
    z-index: 2;
    padding: 24px 26px;
}
.layanan-bento-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: rgba(255,255,255,.2);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
}
.layanan-bento-body h3 {
    font-size: 20px;
    margin: 0 0 8px;
    line-height: 1.35;
}
.layanan-bento-body p {
    font-size: 13px;
    opacity: .9;
    margin: 0 0 12px;
    line-height: 1.55;
}
.layanan-bento-cta {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.layanan-badge-featured {
    position: absolute;
    top: 16px; right: 16px;
    z-index: 3;
    background: rgba(255,255,255,.95);
    color: #c9a227;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    padding: 5px 10px;
    border-radius: 999px;
}

/* Grid cards */
.layanan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}
.layanan-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid #e8eef8;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(48,80,150,.07);
    transition: transform .25s, box-shadow .25s, border-color .25s;
    opacity: 1;
    transform: translateY(0);
}
.layanan-card.is-hidden { display: none; }
.layanan-card.is-reveal {
    animation: layananFadeUp .5s ease both;
}
@keyframes layananFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
.layanan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 44px rgba(48,80,150,.14);
    border-color: rgba(48,122,213,.25);
}
.layanan-card-accent {
    height: 5px;
}
.layanan-card-head {
    padding: 22px 22px 0;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.layanan-card-icon {
    flex: 0 0 52px;
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
}
.layanan-card-meta { flex: 1; min-width: 0; }
.layanan-card-cat {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 3px 9px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.layanan-cat-akademik { background: #e8f0ff; color: #2a5090; }
.layanan-cat-digital { background: #ede7ff; color: #5e35b1; }
.layanan-cat-bimbingan { background: #e8f8ee; color: #1a8a4a; }
.layanan-cat-administrasi { background: #fff3e0; color: #e65100; }
.layanan-cat-umum { background: #eceff1; color: #455a64; }
.layanan-card-meta h3 {
    font-size: 17px;
    line-height: 1.4;
    margin: 0;
}
.layanan-card-meta h3 a {
    color: #1e2d4d;
    text-decoration: none;
}
.layanan-card-meta h3 a:hover { color: var(--theme-secondary, #307ad5); }
.layanan-card-img img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    margin-top: 16px;
}
.layanan-card-body {
    padding: 16px 22px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.layanan-card-body p {
    font-size: 14px;
    color: #5a6b88;
    line-height: 1.65;
    margin: 0 0 16px;
    flex: 1;
}
.layanan-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: gap .2s;
}
.layanan-card-link:hover { gap: 12px; }

.layanan-empty {
    text-align: center;
    padding: 60px 20px;
    color: #7a8aa8;
}
.layanan-empty i { font-size: 48px; margin-bottom: 16px; opacity: .4; }

/* Detail page */
.layanan-detail-wrap {
    background: linear-gradient(180deg, #eef4ff 0%, #fff 280px);
}
.layanan-detail-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e4eaf8;
    box-shadow: 0 16px 48px rgba(48,80,150,.1);
}
.layanan-detail-hero {
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
}
.layanan-detail-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
.layanan-detail-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10,20,40,.3) 0%, rgba(10,20,40,.85) 100%);
}
.layanan-detail-hero-body {
    position: relative;
    z-index: 2;
    padding: 32px 36px;
    color: #fff;
    width: 100%;
}
.layanan-detail-hero-icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    background: rgba(255,255,255,.2);
    backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 14px;
}
.layanan-detail-hero-body h1 {
    font-size: clamp(24px, 4vw, 34px);
    margin: 0 0 10px;
    line-height: 1.3;
}
.layanan-detail-hero-body .excerpt {
    font-size: 15px;
    opacity: .92;
    max-width: 640px;
    margin: 0;
    line-height: 1.6;
}
.layanan-detail-content {
    padding: 32px 36px 40px;
    font-size: 15px;
    line-height: 1.85;
    color: #4a5568;
}
.layanan-detail-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 0;
    border-top: 1px solid #edf1fb;
}
.layanan-detail-main .layanan-detail-content {
    padding: 32px 36px 40px;
}
.layanan-access-panel {
    padding: 28px 24px;
    background: linear-gradient(180deg, #f8faff, #fff);
    border-left: 1px solid #edf1fb;
}
.layanan-access-panel h4 {
    font-size: 16px;
    color: #1e2d4d;
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.layanan-access-panel h4 i { color: var(--theme-secondary, #307ad5); }
.layanan-qrcode-box {
    text-align: center;
    background: #fff;
    border: 1px solid #e4eaf8;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 18px;
}
.layanan-qrcode-box img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
    border-radius: 8px;
}
.layanan-qrcode-box p {
    font-size: 12px;
    color: #7a8aa8;
    margin: 0;
    line-height: 1.5;
}
.layanan-link-box label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #7a8aa8;
    font-weight: 700;
    margin-bottom: 8px;
}
.layanan-link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.layanan-link-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #dde5f5;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: #4a5568;
    background: #fff;
}
.layanan-copy-btn {
    flex: 0 0 42px;
    border: 1px solid #dde5f5;
    background: #fff;
    border-radius: 10px;
    color: var(--theme-secondary, #307ad5);
    cursor: pointer;
    transition: all .2s;
}
.layanan-copy-btn:hover { background: #eef4ff; }
.layanan-copy-btn.is-copied {
    background: #e8f8ee;
    border-color: #00a651;
    color: #00a651;
}
.layanan-access-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity .2s, transform .2s;
}
.layanan-access-btn:hover {
    color: #fff;
    opacity: .92;
    transform: translateY(-1px);
}
.layanan-access-hint {
    font-size: 13px;
    color: #7a8aa8;
    line-height: 1.6;
    margin: 0;
}
.layanan-detail-content p { margin-bottom: 16px; }
.layanan-detail-actions {
    padding: 0 36px 36px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.layanan-related {
    margin-top: 44px;
}
.layanan-related h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #1e2d4d;
}
.layanan-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.layanan-related-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e4eaf8;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s;
}
.layanan-related-item:hover {
    box-shadow: 0 8px 24px rgba(48,80,150,.1);
}
.layanan-related-item i {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}
.layanan-related-item h5 {
    font-size: 14px;
    margin: 0 0 4px;
    color: #1e2d4d;
}
.layanan-related-item span {
    font-size: 12px;
    color: #7a8aa8;
}

/* Lampiran gambar / PDF */
.layanan-attachments {
    padding: 28px 36px 32px;
    border-top: 1px solid #edf1fb;
    background: linear-gradient(180deg, #fafbff, #fff);
}
.layanan-attachments h4 {
    font-size: 18px;
    color: #1e2d4d;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.layanan-attachments h4 i { color: var(--theme-secondary, #307ad5); }
.layanan-attachments-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.layanan-attachment-item {
    background: #fff;
    border: 1px solid #e4eaf8;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(48,80,150,.06);
}
.layanan-attachment-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: #f8faff;
    border-bottom: 1px solid #edf1fb;
}
.layanan-attachment-item-head h5 {
    margin: 0;
    font-size: 15px;
    color: #1e2d4d;
    display: flex;
    align-items: center;
    gap: 8px;
}
.layanan-attachment-download {
    font-size: 12px;
    font-weight: 700;
    color: var(--theme-secondary, #307ad5);
    text-decoration: none;
    white-space: nowrap;
}
.layanan-attachment-download:hover { text-decoration: underline; }
.layanan-attachment-item-body { padding: 16px; }
.layanan-attachment-pdf {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e4eaf8;
    background: #f5f7fb;
}
.layanan-pdf-embed {
    width: 100%;
    height: 520px;
    border: 0;
    display: block;
    background: #fff;
}
.layanan-attachment-image-link {
    display: block;
    text-align: center;
}
.layanan-attachment-image-link img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid #e4eaf8;
    box-shadow: 0 4px 16px rgba(48,80,150,.08);
}

@media (max-width: 991px) {
    .layanan-hero-inner { grid-template-columns: 1fr; }
    .layanan-hero-stats { justify-content: flex-start; }
    .layanan-bento-card:nth-child(1),
    .layanan-bento-card:nth-child(2),
    .layanan-bento-card:nth-child(3) {
        grid-column: span 12;
    }
}
@media (max-width: 767px) {
    .layanan-toolbar { flex-direction: column; align-items: stretch; }
    .layanan-search { max-width: none; }
    .layanan-detail-layout { grid-template-columns: 1fr; }
    .layanan-access-panel { border-left: 0; border-top: 1px solid #edf1fb; }
    .layanan-detail-hero-body,
    .layanan-detail-main .layanan-detail-content,
    .layanan-detail-actions { padding-left: 20px; padding-right: 20px; }
    .layanan-access-panel { padding: 22px 20px; }
    .layanan-attachments { padding: 22px 20px; }
    .layanan-pdf-embed { height: 360px; }
}
