/* ============================================================
   KRU Platform — Landing Page Custom Styles
   Tailwind CDN จัดการ utility classes ทั้งหมด; ไฟล์นี้เก็บเฉพาะ
   custom styles ที่ Tailwind ทำไม่ได้ (animations, custom components,
   print rules, iframe responsive)
   ============================================================ */

/* ── Background pattern (subtle dot grid) ── */
.bg-pattern {
    background-image: radial-gradient(#94A3B8 1px, transparent 1px);
    background-size: 28px 28px;
}

/* ── Smooth transitions ── */
.transition-all-custom {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Focus visible (accessibility — applies to all interactive) ── */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
iframe:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #3B82F6;
    border-radius: 0.5rem;
}

/* ── Skip link (visible only on focus) ── */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    z-index: 100;
    padding: 0.75rem 1.25rem;
    background: #2563EB;
    color: #FFFFFF;
    font-weight: 700;
    border-radius: 0 0 0.5rem 0;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
}

/* ── App Launcher dropdown animation ── */
.app-launcher-menu {
    transform-origin: top right;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.app-launcher-menu[aria-hidden="true"] {
    opacity: 0;
    transform: scale(0.95) translateY(-4px);
    pointer-events: none;
}
.app-launcher-menu[aria-hidden="false"] {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* ── Modal focus trap helpers ── */
body.modal-open {
    overflow: hidden;
}

/* ── Timetable iframe responsive height ── */
.timetable-frame {
    width: 100%;
    border: 0;
    min-height: 640px;
    display: block;
}
@media (max-width: 640px) {
    .timetable-frame {
        min-height: 540px;
    }
}
@media (min-width: 1280px) {
    .timetable-frame {
        min-height: 720px;
    }
}

/* ── App card hover lift ── */
.app-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.app-card:hover {
    transform: translateY(-2px);
}

/* ── Coming-soon dashed card ── */
.app-card-coming-soon {
    border-style: dashed;
    background: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 8px,
        rgba(148, 163, 184, 0.06) 8px,
        rgba(148, 163, 184, 0.06) 16px
    );
}

/* ── Print rules (for timetable iframe content if user prints) ── */
@media print {
    body { background: white !important; }
    .no-print { display: none !important; }
}

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