/* ============================================
   APP.CSS — WordPress Block & Layout Overrides
   Moran College Official
   ============================================ */

/* Override WordPress block editor defaults */
.wp-block-group,
.wp-block-columns,
.wp-block-cover,
.wp-block-image,
.wp-block-gallery {
    margin-top: 0;
    margin-bottom: var(--space-md);
}

/* Remove default WP paragraph margins */
.app-content .wp-block-paragraph {
    margin-bottom: var(--space-md);
}

/* WordPress pagination */
.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-lg) 0;
}

.nav-links .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-links .page-numbers.current {
    background: var(--primary);
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.nav-links .page-numbers:hover:not(.current) {
    background: rgba(108, 99, 255, 0.08);
    color: var(--primary);
}

/* ============================================
   HOMEPAGE SPECIFIC OVERRIDES
   ============================================ */

.app-home .app-banner {
    margin-top: -8px;
}

.app-home .section-header {
    padding-top: var(--space-sm);
}

/* Stagger animation for homepage sections */
.app-home section:nth-child(1) { animation-delay: 0s; }
.app-home section:nth-child(2) { animation-delay: 0.08s; }
.app-home section:nth-child(3) { animation-delay: 0.16s; }
.app-home section:nth-child(4) { animation-delay: 0.24s; }
.app-home section:nth-child(5) { animation-delay: 0.32s; }

/* ============================================
   QUICK ACTIONS — ICON SVG SIZING
   ============================================ */

.quick-action-icon span {
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action-icon svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   NOTICE LIST ENHANCEMENTS
   ============================================ */

.notice-item .notice-icon span {
    display: flex;
}

.notice-item .notice-icon span svg {
    width: 20px;
    height: 20px;
}

/* Different left border colors per notice priority group */
.notice-item[style*="accent-pink"] {
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-left-width: 3px; }
    50% { border-left-width: 5px; }
}

/* ============================================
   SEARCH BAR ICON FIX
   ============================================ */

.search-input-wrap > span {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
}

.search-input-wrap > span svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

/* ============================================
   GALLERY ITEM TOUCH EFFECT
   ============================================ */

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 0 rgba(108, 99, 255, 0.3);
    transition: box-shadow 0.3s ease;
}

.gallery-item:active::after {
    box-shadow: inset 0 0 0 3px rgba(108, 99, 255, 0.5);
}

/* ============================================
   SINGLE PAGE ACTION BUTTONS
   ============================================ */

.single-content a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: rgba(108, 99, 255, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s ease;
}

.single-content a:hover {
    text-decoration-color: var(--primary);
}

/* ============================================
   META BAR ICON ALIGNMENT
   ============================================ */

.single-meta-bar span[class^="badge"] {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.single-meta-bar .text-muted span {
    display: inline-flex;
    align-items: center;
}

.single-meta-bar .text-muted svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   SMOOTH TOUCH FEEDBACK
   ============================================ */

/* Remove default flash globally */
* {
    -webkit-tap-highlight-color: transparent !important;
}

/* Add smooth app-like scale on tap */
a:active,
button:active,
.card:active,
.event-card:active,
.notice-item:active,
.gallery-item:active,
.quick-action-item:active,
.mc-action-card:active {
    transform: scale(0.97) !important;
    opacity: 0.85;
    transition: transform 0.1s ease, opacity 0.1s ease !important;
}

/* Fix sticky hover states causing "black shadow" on mobile */
@media (hover: none) {
    .card:hover {
        box-shadow: var(--shadow-card) !important;
        transform: none !important;
    }
    .event-card:hover,
    .notice-item:hover,
    .gallery-item:hover,
    .quick-action-item:hover,
    .mc-action-card:hover,
    .banner-slide-btn:hover,
    .mc-btn-primary:hover,
    button:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* ============================================
   BOTTOM NAV — RESPONSIVE LABEL
   ============================================ */

@media (max-width: 340px) {
    .bottom-nav-item span {
        font-size: 9px;
    }
    .bottom-nav-item.active .nav-icon-wrap {
        width: 44px;
        height: 44px;
    }
}

/* ============================================
   BOTTOM NAV — ACTIVE INDICATOR LINE
   ============================================ */

.bottom-nav-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(108, 99, 255, 0.1), transparent);
}

/* ============================================
   STAT CARD ANIMATION
   ============================================ */

.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   SCROLL REVEAL — IntersectionObserver target
   ============================================ */

.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   CHIP FILTER — Active state transitions
   ============================================ */

.chip {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.chip.active {
    transform: scale(1.02);
}

/* ============================================
   SAFE AREA PADDING FOR NOTCHED PHONES
   ============================================ */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .app-content {
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + var(--space-xl));
    }
}

/* ============================================
   404 PAGE
   ============================================ */

.error-404-content {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
}

.error-404-content .error-code {
    font-size: 72px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
}

.error-404-content h2 {
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.error-404-content p {
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.error-404-content a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--primary-gradient);
    color: var(--text-white);
    border-radius: var(--radius-xl);
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.error-404-content a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--text-white);
}

/* ============================================
   PRINT STYLES (for notice printing)
   ============================================ */

@media print {
    .app-header,
    .bottom-nav,
    .banner-slider,
    .quick-actions {
        display: none !important;
    }

    .app-content {
        padding: 0;
    }

    .app-wrapper {
        max-width: 100%;
        box-shadow: none;
    }
}
