/* ==========================================================================
   Christian Honours - Definitive Stylesheet with Mobile-Friendly Modal
   ========================================================================== */

/* --- 1. Global Settings --- */
:root {
    --purple: #622e8a;
    --gold: #f2c14e;
    --white: #FFFFFF;
    --text-dark: #333;
    --background-color: #f7f8fa;
    --border-color: #e9e9e9;
}
*, *::before, *::after { box-sizing: border-box; } /* Ensures padding doesn't break layouts */
body { font-family: 'Montserrat', sans-serif; margin: 0; background-color: var(--background-color); color: var(--text-dark); }

/* --- 2. Hero Section --- */
.hero-section { background-color: var(--purple); color: var(--white); text-align: center; padding: 70px 20px; }
.hero-section h1 { font-size: 3.2em; font-weight: 800; margin: 0 0 15px 0; }
.hero-section p { font-size: 1.1em; max-width: 600px; margin: 0 auto; opacity: 0.9; }

/* --- 3. Main Content & Section Title --- */
.container { max-width: 1300px; margin: 0 auto; padding: 60px 20px; }
.section-title { text-align: center; font-size: 1.8em; font-weight: 700; color: var(--purple); text-transform: uppercase; letter-spacing: 1px; margin: 0 0 50px 0; }

/* --- 4. 4-COLUMN CARD DESIGN --- */
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; }
.card { background-color: var(--white); border: 1px solid var(--border-color); border-top: 4px solid var(--gold); border-radius: 6px; padding: 25px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; justify-content: space-between; text-align: center; min-height: 160px; }
.card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.07); }
.card-title { font-size: 1.4em; font-weight: 700; color: #222; margin: 0; line-height: 1.3; flex-grow: 1; display: flex; align-items: center; justify-content: center; }
.card-button { background-color: var(--purple); color: var(--white); border: none; border-radius: 5px; padding: 12px 25px; font-size: 0.9em; font-weight: 700; cursor: pointer; transition: background-color 0.2s; font-family: 'Montserrat', sans-serif; text-transform: uppercase; letter-spacing: 0.5px; }
.card-button:hover { background-color: #502570; }
.card-button:disabled { background-color: #b0b0b0; cursor: not-allowed; }

/* --- Media Queries for Grid --- */
@media (max-width: 1200px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 992px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) { .card-grid { grid-template-columns: 1fr; } }

/* --- 5. FINAL, MOBILE-FRIENDLY MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 20, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 1000;
    /* THIS IS THE KEY FIX: Adds 'breathing room' on all screens */
    padding: 15px; 
}
.modal-overlay.visible { opacity: 1; visibility: visible; }

.modal-content {
    background-color: var(--white);
    border-radius: 8px;
    width: 100%; /* Take up the full width of the padded overlay */
    max-width: 600px; /* But don't get wider than 600px on desktop */
    max-height: 100%; /* Take up the full height of the padded overlay */
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.modal-overlay.visible .modal-content { transform: scale(1); }

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Prevents the header from shrinking */
}
.form-title { font-size: 1.2em; font-weight: 700; color: var(--purple); margin: 0; }
.modal-close-button { background: none; border: none; font-size: 2em; color: #aaa; cursor: pointer; line-height: 1; }

.modal-body {
    padding: 30px;
    overflow-y: auto; /* Makes only this section scrollable if content overflows */
}
.modal-category-display { font-size: 1.5em; font-weight: 700; color: var(--text-dark); text-align: center; margin-top: 0; margin-bottom: 25px; padding-bottom: 25px; border-bottom: 2px solid var(--gold); }
.form-group { margin-bottom: 22px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 0.9em; }
.form-group input { width: 100%; padding: 14px; border: 1px solid #ccc; border-radius: 5px; font-size: 1em; }
.form-group input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 8px rgba(98, 46, 138, 0.2); }
.form-divider { border: 0; height: 1px; background-color: #eee; margin: 30px 0; }
.submit-button { width: 100%; background-color: var(--purple); color: var(--white); border: none; border-radius: 5px; padding: 16px; font-size: 1.1em; font-weight: 700; cursor: pointer; transition: background-color 0.2s; }
.submit-button:hover { background-color: #502570; }

.message-success, .message-error { text-align: center; font-weight: bold; padding: 10px; border-radius: 5px; margin-top: 15px; }
.message-success { color: #155724; background-color: #d4edda; }
.message-error { color: #721c24; background-color: #f8d7da; }