/* CSS Desktop & Mobile Responsive - SMAN 1 Palmatak */
:root {
    --primary-color: #0d3b66;
    --secondary-color: #f4d35e;
    --accent-color: #ee964b;
    --dark-bg: #0d1b2a;
    --light-bg: #f8f9fa;
    --text-color: #2b2d42;
    --border-color: #e0e0e0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--light-bg);
    line-height: 1.6;
}

/* Header & Nav */
.header-top {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    display: block;
}

.brand-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

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

.brand-info img {
    height: 50px;
    width: auto;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.brand-sub {
    font-size: 0.85rem;
    color: #d0d7de;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    font-size: 1.4rem;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

/* Navigation bar */
.nav-bar {
    background-color: #1b263b;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

.nav-menu li a {
    display: block;
    padding: 12px 16px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.nav-menu li a:hover, .nav-menu li a.active {
    background-color: var(--accent-color);
    color: #fff;
}

/* Main Layout */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

/* Banner Card H1 */
.banner-card {
    background: linear-gradient(135deg, var(--primary-color), #1b263b);
    color: white;
    padding: 25px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.banner-card h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    color: var(--secondary-color);
}

.banner-card p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Card Grid */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 6px;
}

.card-link {
    display: inline-block;
    margin-top: 12px;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.card-link:hover {
    text-decoration: underline;
}

/* Responsive Table / Card View */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border-color);
}

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

/* News Article list */
.news-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.news-item h3 {
    margin-bottom: 8px;
}

.news-item h3 a {
    color: var(--primary-color);
    text-decoration: none;
}

.news-meta {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 10px;
}

/* Partner Links Div */
.random-links {
    background: #e9ecef;
    padding: 15px;
    border-radius: 6px;
    margin: 30px 0 15px 0;
    font-size: 0.9rem;
    border: 1px solid #ced4da;
}

.random-links h4 {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.random-links a {
    color: #0d6efd;
    text-decoration: none;
    display: inline-block;
}

.random-links a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: var(--dark-bg);
    color: white;
    padding: 25px 15px;
    text-align: center;
    font-size: 0.9rem;
    margin-top: 20px;
}

footer p {
    margin: 5px 0;
}

/* Image styles */
.hero-img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.logo-download-box {
    text-align: center;
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.logo-download-box img {
    max-width: 150px;
    height: auto;
    margin-bottom: 15px;
}

/* Responsive Mobile Navigation & Tables */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    .nav-menu.show {
        display: flex;
    }

    .nav-menu li a {
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    /* Mobile Table as Cards */
    .responsive-table-card table, 
    .responsive-table-card thead, 
    .responsive-table-card tbody, 
    .responsive-table-card th, 
    .responsive-table-card td, 
    .responsive-table-card tr {
        display: block;
    }

    .responsive-table-card thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .responsive-table-card tr {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 15px;
        background: white;
        padding: 10px;
    }

    .responsive-table-card td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 45%;
        text-align: right;
    }

    .responsive-table-card td:last-child {
        border-bottom: 0;
    }

    .responsive-table-card td:before {
        position: absolute;
        top: 12px;
        left: 10px;
        width: 40%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: var(--primary-color);
        content: attr(data-label);
    }
}
