/* --- Root Variables & Design System --- */
:root {
    --primary-color: #0d9488;
    --primary-hover: #0f766e;
    --secondary-color: #1e293b;
    --accent-color: #f59e0b;
    --bg-light: #f8fafc;
    --surface-white: #ffffff;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-sm: 6px;
    --radius-md: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --transition: all 0.25s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* --- Topbar --- */
.topbar {
    background-color: var(--secondary-color);
    color: #e2e8f0;
    font-size: 0.85rem;
    padding: 8px 0;
}

.topbar-content {
    display: flex;
    justify-content: flex-end;
    gap: 24px;
}

.topbar-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-item.highlight {
    color: var(--accent-color);
}

/* --- Main Navigation --- */
.main-header {
    background: var(--surface-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.brand-title {
    display: block;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--secondary-color);
    letter-spacing: 0.5px;
}

.brand-subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-menu ul {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-menu a {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--primary-color);
}

.btn-login {
    background-color: var(--primary-color);
    color: white !important;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
}

.btn-login:hover {
    background-color: var(--primary-hover);
}

/* --- Hero Section (Fixed Height & Background Image Handling) --- */
.hero {
    position: relative;
    height: 380px; /* Fixed height across Home, Calendar, and Announcements */
    display: flex;
    align-items: center;
    color: white;
    overflow: hidden;
    
    /* Center and format background image to prevent zooming */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Modifier class for sub-pages (Calendar & Announcements) if needed */
.hero.page-hero {
    height: 380px; /* Kept exactly identical to main hero for uniform size */
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
    width: 100%;
}

.badge {
    background: rgba(13, 148, 136, 0.2);
    color: #2dd4bf;
    border: 1px solid rgba(45, 212, 191, 0.3);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 16px;
}

.hero-title {
    font-size: 2.75rem;
    line-height: 1.15;
    font-weight: 800;
    margin-bottom: 12px;
}

.text-accent {
    color: var(--accent-color);
}

.hero-description {
    color: #cbd5e1;
    font-size: 1.05rem;
    margin-bottom: 24px;
    max-width: 580px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* --- Content Sections --- */
.main-content {
    padding: 60px 20px;
}

.content-section {
    margin-bottom: 60px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.view-all {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.view-all:hover {
    color: var(--primary-hover);
}

/* --- Cards Grid --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.card {
    background: var(--surface-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-image-wrapper {
    position: relative;
    height: 180px;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-date-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.85);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    backdrop-filter: blur(4px);
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--secondary-color);
}

.card-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Announcements --- */
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.announcement-item {
    display: flex;
    gap: 16px;
    background: var(--surface-white);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.announcement-icon {
    background-color: rgba(13, 148, 136, 0.1);
    color: var(--primary-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.announcement-details {
    flex-grow: 1;
}

.announcement-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.announcement-title {
    font-size: 1.05rem;
    color: var(--secondary-color);
}

.announcement-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.announcement-text {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.empty-state {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
}

/* --- Footer --- */
.footer {
    background-color: var(--secondary-color);
    color: #94a3b8;
    padding-top: 60px;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.footer-logo {
    width: 32px;
    height: 32px;
}

.footer-heading {
    color: white;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.footer-address a {
    color: #94a3b8;
    text-decoration: none;
    transition: var(--transition);
}

.footer-address a:hover {
    color: white;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    background-color: #0f172a;
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container { height: auto; padding: 16px; flex-direction: column; gap: 16px; }
    .nav-menu ul { gap: 16px; flex-wrap: wrap; justify-content: center; }
    
    .hero, .hero.page-hero { 
        height: auto; 
        min-height: 320px; 
        padding: 40px 0; 
    }
    .hero-title { font-size: 2.2rem; }
    .hero-actions { flex-direction: column; }
    
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .topbar-content { justify-content: center; flex-direction: column; gap: 4px; text-align: center; }
}


/* ==========================================
   PUBLIC BHEAMS WEBSITE — MOBILE ONLY
   Existing desktop styles remain unchanged.
   ========================================== */

@media screen and (max-width: 768px) {

    /* Prevent horizontal overflow */
    body {
        width: 100%;
        overflow-x: hidden;
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Hotline and emergency bar */
    .topbar-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .topbar-item {
        flex-wrap: wrap;
        font-size: 0.78rem;
        gap: 6px;
    }

    /* Logo and brand */
    .nav-container {
        height: auto;
        min-height: 0;
        padding-top: 12px;
        padding-bottom: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .brand {
        width: 100%;
        min-width: 0;
        gap: 10px;
    }

    .brand-logo {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .brand-text {
        min-width: 0;
    }

    .brand-title {
        font-size: 0.95rem;
        line-height: 1.3;
    }

    .brand-subtitle {
        font-size: 0.75rem;
    }

    /* Navigation links */
    .nav-menu {
        width: 100%;
        min-width: 0;
    }

    .nav-menu ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
    }

    .nav-menu a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    /* Hero banner */
    .hero,
    .hero.page-hero {
        height: auto;
        min-height: 280px;
        padding: 40px 0;
        background-size: cover;
        background-position: center;
    }

    .hero-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hero-title {
        font-size: clamp(1.8rem, 7vw, 2.3rem);
        line-height: 1.2;
        overflow-wrap: break-word;
    }

    .hero-description {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    /* Main content */
    main.container.main-content {
        padding-top: 32px;
        padding-bottom: 32px;
    }

    .content-section {
        margin-bottom: 36px;
        min-width: 0;
    }

    .section-header {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 18px;
    }

    .section-header h2 {
        font-size: 1.3rem;
    }

    /* Event cards */
    .cards-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .card {
        width: 100%;
        min-width: 0;
    }

    .card-body,
    .card-title,
    .card-text {
        overflow-wrap: anywhere;
    }

    /* Announcements */
    .announcement-item {
        min-width: 0;
        padding: 14px;
        gap: 12px;
        align-items: flex-start;
    }

    .announcement-icon {
        flex-shrink: 0;
        width: 38px;
        height: 38px;
    }

    .announcement-details {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .announcement-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .footer-address,
    .footer-desc {
        overflow-wrap: anywhere;
    }
}

/* Small phones */
@media screen and (max-width: 380px) {

    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .brand-title {
        font-size: 0.85rem;
    }

    .nav-menu ul {
        gap: 5px;
    }

    .nav-menu a {
        padding: 7px 8px;
        font-size: 0.76rem;
    }

    .hero,
    .hero.page-hero {
        min-height: 260px;
        padding: 32px 0;
    }

    .hero-title {
        font-size: 1.7rem;
    }
}
