/* =========================================================
   HOME PAGE STYLES (PTKD)
   File: resources/css/home.css
   Catatan: jangan bungkus dengan <style> ... </style>
   ========================================================= */

/* ---------- Utilitas umum ---------- */
img { display:block; max-width:100%; height:auto; }
.justified-text p{
    text-align:justify;
    text-justify:inter-word;
    hyphens:auto;
}

/* ---------- Showcase Berita (filter & grid) ---------- */
.news-showcase .filter a{
    font-size:.85rem;
    color:#6b7280;
    text-decoration:none;
    margin-left:1rem;
}
.news-showcase .filter a.active{
    color:#0d4e96;
    font-weight:700;
}

/* grid berita (3 kolom desktop, 1 kolom mobile) */
.news-grid{ display:grid; gap:18px; }
@media (min-width:768px){ .news-grid{ grid-template-columns:repeat(3,1fr); } }
@media (max-width:767.98px){ .news-grid{ grid-template-columns:1fr; gap:14px; } }

/* ---------- Kartu Berita (terang; match activity-card) ---------- */
.news-card{
    position:relative;
    border:0; border-radius:16px; overflow:hidden;
    background:#fff; color:#0f172a;
    box-shadow:0 10px 26px rgba(0,0,0,.06);
    transition:transform .25s, box-shadow .25s;
    min-height:auto;
}
.news-card:hover{ transform:translateY(-3px); box-shadow:0 16px 40px rgba(0,0,0,.10); }

/* media ditempatkan di atas (rasio 16:9) */
.news-card .media{
    position:relative;
    width:100%;
    padding-top:56.25%; /* 16:9 */
    background-size:cover; background-position:center;
}
/* jika memakai <img> di dalam .ratio */
.ratio-16x9 img{ width:100%; height:100%; object-fit:cover; }

/* nonaktifkan overlay gelap lama */
.news-card .shade{ display:none; }

/* body/meta */
.news-card .meta{
    position:static;
    padding:16px 18px;
    color:#0f172a;
    background:#fff;
}
.news-card .meta .kecil{ font-size:.75rem; color:#6b7280; margin-bottom:.35rem; opacity:1; }
.news-card .meta h3{ font-size:1rem; line-height:1.35; margin:0 0 .35rem 0; }
.news-card .meta p{ font-size:.9rem; color:#6b7280; margin:0; }

/* chip kategori pada gambar */
.news-card .badge-cat{
    position:absolute; top:12px; left:12px;
    background:#eef4ff; color:#0d4e96;
    border-radius:999px; font-weight:700; font-size:.75rem;
    padding:.25rem .6rem;
    box-shadow:0 2px 8px rgba(13,78,150,.12);
}

/* link judul */
.news-card .meta a.stretched-link{
    color:#0f172a; text-decoration:none;
}
.news-card .meta a.stretched-link:hover{ text-decoration:underline; }

/* ---------- Kegiatan Korporasi ---------- */
.activity-card{
    border:0; border-radius:16px; overflow:hidden;
    box-shadow:0 10px 26px rgba(0,0,0,.06);
    transition:transform .25s, box-shadow .25s;
    background:#fff;
}
.activity-card:hover{ transform:translateY(-3px); box-shadow:0 16px 40px rgba(0,0,0,.10); }
.chip{
    border-radius:999px; padding:.25rem .6rem;
    background:#eef4ff; color:#0d4e96;
    font-weight:600; font-size:.75rem;
}

/* ---------- Pencapaian (final, elegan & stabil) ---------- */
.achievements-grid{
    display:grid; gap:18px;
    grid-template-columns:repeat(2,1fr);
}
@media (min-width:768px){ .achievements-grid{ grid-template-columns:repeat(3,1fr); } }
@media (min-width:992px){ .achievements-grid{ grid-template-columns:repeat(4,1fr); } }

/* kartu */
.ach-card{
    position:relative; border:0; border-radius:18px; overflow:hidden;
    background:#fff;
    box-shadow:0 10px 26px rgba(0,0,0,.06);
    transition:transform .25s ease, box-shadow .25s ease, filter .25s ease;
    isolation:isolate;
}
.ach-card:hover{ transform:translateY(-4px); box-shadow:0 18px 42px rgba(0,0,0,.12); }
.ach-card:focus-visible{ outline:3px solid #0d6efd; outline-offset:3px; }

/* ratio & gambar */
.ach-wrap{ width:100%; height:100%; position:relative; }
.ach-square .ach-wrap{ aspect-ratio:1/1; }
.ach-wide   .ach-wrap{ aspect-ratio:16/9; }
.ach-tall   .ach-wrap{ aspect-ratio:3/4; }

.ach-img{
    position:absolute; inset:0; width:100%; height:100%;
    object-fit:contain; /* ubah ke 'cover' jika ingin penuh */
    padding:18px;
    filter:grayscale(15%); opacity:.95;
    transition:transform .45s ease, filter .25s, opacity .25s;
}
.ach-card:hover .ach-img{ filter:none; opacity:1; transform:scale(1.03) rotate(.3deg); }

/* efek kilau lembut */
.ach-card::after{
    content:""; position:absolute; inset:-200% -50% auto -50%;
    height:200%; transform:rotate(20deg);
    background:linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.35) 50%, rgba(255,255,255,0) 100%);
    opacity:0; transition:opacity .25s, transform .8s ease;
}
.ach-card:hover::after{ opacity:1; transform:rotate(20deg) translateX(60%); }

/* caption */
.ach-caption{
    font-size:.85rem; text-align:center; color:#6b7280;
    padding:10px 12px 14px; transition:color .2s ease;
}
.ach-card:hover .ach-caption{ color:#374151; }

/* variasi layout tambahan di desktop besar */
@media (min-width:992px){
    .achievements-grid > .ach-wide:nth-child(6n + 1){ grid-column: span 2; }
    .achievements-grid > .ach-tall:nth-child(8n + 3){ grid-row: span 2; }
}

/* animasi reveal (dikendalikan JS sederhana di home.blade) */
.ach-reveal{ opacity:0; transform:translateY(16px) scale(.98); transition:opacity .6s ease, transform .6s ease; }
.ach-reveal.is-in{ opacity:1; transform:none; }

/* hormati preferensi aksesibilitas */
@media (prefers-reduced-motion: reduce){
    .ach-card, .ach-img, .ach-card::after, .ach-reveal{ transition:none !important; }
}

/* ---------- Tambahan kecil untuk news-list versi card ---------- */
.news-filter a{ font-size:.85rem; text-decoration:none; color:#6b7280; margin-left:1rem; }
.news-filter a.active{ color:#0d4e96; font-weight:700; }
.news-chip{
    border-radius:999px; padding:.25rem .6rem;
    background:#eef4ff; color:#0d4e96;
    font-weight:700; font-size:.75rem;
}

/* pagination minimal (jika dipakai di index berita) */
.pager{ display:flex; gap:.5rem; align-items:center; justify-content:center; }
.pager a, .pager span{
    display:inline-flex; align-items:center; justify-content:center;
    min-width:40px; height:40px; padding:0 .75rem;
    border-radius:10px; border:1px solid #e5e7eb; background:#fff; color:#0f172a;
    text-decoration:none; font-weight:600; font-size:.9rem;
}
.pager .active{ background:#0d4e96; color:#fff; border-color:#0d4e96; }

/* =========================================================
   PENCAPAIAN / ACHIEVEMENTS (BEAUTIFUL & REFINED)
   Modern, elegant design with smooth animations
   ========================================================= */

/* ---------- Section Background Decoration ---------- */
.achievements-bg-deco {
    position: absolute;
    top: -10%;
    right: -5%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(13, 78, 150, 0.03) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.achievements-bg-deco::before {
    content: "";
    position: absolute;
    top: 20%;
    left: 30%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.04) 0%, transparent 70%);
    border-radius: 50%;
}

/* ---------- Header Styling ---------- */
.achievements-pretitle {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: #0d4e96;
    font-weight: 600;
}

.achievements-title {
    background: linear-gradient(135deg, #0d4e96 0%, #0d6efd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Grid Layout (Responsive & Masonry-like) ---------- */
.achievements-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(180px, auto);
}

@media (min-width: 576px) {
    .achievements-grid {
        gap: 22px;
    }
}

@media (min-width: 768px) {
    .achievements-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

@media (min-width: 992px) {
    .achievements-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 26px;
    }
}

@media (min-width: 1400px) {
    .achievements-grid {
        gap: 28px;
    }
}

/* ---------- Card Base Styles (Premium Look) ---------- */
.ach-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition:
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.4s ease,
        filter 0.3s ease;
    isolation: isolate;
    contain: layout style paint;
    will-change: transform;
}

.ach-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(13, 78, 150, 0.1);
}

.ach-card:focus-within {
    outline: none;
}

.ach-link:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 4px;
    border-radius: 20px;
}

/* ---------- Size Variants (Aspect Ratios) ---------- */
.ach-wrap {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.ach-square .ach-wrap { min-height: 280px; }
.ach-wide   .ach-wrap { min-height: 220px; }
.ach-tall   .ach-wrap { min-height: 400px; }

@media (min-width: 768px) {
    .ach-square .ach-wrap { min-height: 320px; }
    .ach-wide   .ach-wrap { min-height: 240px; }
    .ach-tall   .ach-wrap { min-height: 480px; }
}

/* ---------- Grid Spanning (Desktop) ---------- */
@media (min-width: 992px) {
    .achievements-grid > .ach-wide {
        grid-column: span 2;
    }

    .achievements-grid > .ach-tall {
        grid-row: span 2;
    }
}

/* ---------- Year Badge ---------- */
.ach-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, #0d4e96 0%, #0d6efd 100%);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 100px;
    box-shadow: 0 4px 12px rgba(13, 78, 150, 0.3);
    z-index: 3;
    transform: translateY(0);
    transition: transform 0.3s ease;
    letter-spacing: 0.05em;
}

.ach-card:hover .ach-badge {
    transform: translateY(-4px) scale(1.05);
}

/* ---------- Image Container ---------- */
.ach-img-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    overflow: hidden;
}

.ach-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 24px;
    filter: grayscale(8%) brightness(0.98) contrast(1.02);
    opacity: 0.96;
    transition:
        transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
        filter 0.3s ease,
        opacity 0.3s ease;
}

.ach-card:hover .ach-img {
    filter: none;
    opacity: 1;
    transform: scale(1.08) rotate(1deg);
}

/* Error state */
.ach-img-error {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.ach-img-error::after {
    content: "🏆";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    opacity: 0.2;
}

/* ---------- Hover Overlay ---------- */
.ach-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13, 78, 150, 0.92) 0%, rgba(13, 110, 253, 0.92) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(8px);
}

.ach-card:hover .ach-overlay {
    opacity: 1;
    transform: scale(1);
}

.ach-overlay-content {
    color: #ffffff;
    text-align: center;
    transform: translateY(10px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s;
}

.ach-card:hover .ach-overlay-content {
    transform: translateY(0);
}

/* ---------- Caption Styling ---------- */
.ach-caption {
    padding: 18px 20px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease;
}

.ach-card:hover .ach-caption {
    background: #f8f9fa;
}

.ach-caption-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.ach-card:hover .ach-caption-title {
    color: #0d4e96;
}

.ach-caption-meta {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---------- Shimmer Effect (Premium Touch) ---------- */
.ach-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    transform: skewX(-20deg);
    transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    pointer-events: none;
}

.ach-card:hover::before {
    left: 100%;
}

/* ---------- Reveal Animation with Stagger ---------- */
.ach-reveal {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition:
        opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

.ach-reveal.is-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ---------- Button Enhancement ---------- */
.btn-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(13, 78, 150, 0.2);
}

/* ---------- Stats Section ---------- */
.achievements-stats {
    animation: fadeInUp 0.8s ease 0.4s both;
}

.stat-number {
    background: linear-gradient(135deg, #0d4e96 0%, #0d6efd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: countUp 1s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Accessibility: Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .ach-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .ach-card {
        will-change: auto;
    }
}

/* ---------- Dark Mode Support (Optional) ---------- */
@media (prefers-color-scheme: dark) {
    .ach-card {
        background: #1e293b;
        box-shadow:
            0 4px 6px -1px rgba(0, 0, 0, 0.3),
            0 2px 4px -1px rgba(0, 0, 0, 0.2);
    }

    .ach-card:hover {
        box-shadow:
            0 20px 25px -5px rgba(0, 0, 0, 0.5),
            0 10px 10px -5px rgba(0, 0, 0, 0.3);
    }

    .ach-img-container {
        background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    }

    .ach-caption {
        background: #1e293b;
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    .ach-caption-title {
        color: #f8fafc;
    }

    .ach-card:hover .ach-caption {
        background: #334155;
    }
}

/* ---------- Print Styles ---------- */
@media print {
    .ach-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    .ach-overlay,
    .ach-badge,
    .btn-hover-lift {
        display: none !important;
    }
}
