/* Cleveland Hall HOA - Modern Stylesheet */

:root {
    --navy: #1a2744;
    --navy-light: #243354;
    --navy-dark: #0f1a2e;
    --red-accent: #c0392b;
    --red-hover: #e74c3c;
    --gold: #d4a84b;
    --gold-light: #f0d48a;
    --cream: #faf8f5;
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --text: #2c3e50;
    --text-light: #5a6a7a;
    --link: #1a5276;
    --link-hover: #c0392b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --max-width: 1100px;
    --sidebar-width: 280px;
    --transition: 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
    color: var(--text);
    background: var(--gray-100);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; }

/* ========== HEADER ========== */
.site-header {
    background: var(--navy);
    color: var(--white);
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem 0.5rem;
    text-align: center;
}

.site-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--white);
    margin-bottom: 0.15rem;
}

.site-title a { color: var(--white); }
.site-title a:hover { color: var(--gold-light); }

.site-subtitle {
    font-size: 0.9rem;
    color: var(--gold);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    padding-bottom: 0;
}

.main-nav a {
    display: inline-block;
    padding: 0.55rem 0.85rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}

.main-nav a:hover {
    background: var(--red-accent);
    color: var(--white);
}

.main-nav a.active {
    background: var(--white);
    color: var(--navy);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: 2px solid rgba(255,255,255,0.5);
    color: var(--white);
    padding: 0.4rem 0.8rem;
    font-size: 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 0.5rem;
}

/* ========== LAYOUT ========== */
.page-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 1.5rem;
    align-items: start;
}

.content-area {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 2rem 2.5rem;
    min-height: 400px;
}

/* ========== PAGE TITLE ========== */
.page-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--gold);
    display: inline-block;
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-card {
    background: var(--navy);
    color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    text-align: center;
}

.sidebar-card .house-img {
    width: 160px;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.sidebar-card h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.sidebar-card .location {
    font-size: 0.85rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin: 1rem 0;
}

.sidebar-card .pm-section { font-size: 0.82rem; line-height: 1.7; }
.sidebar-card .pm-section strong { color: var(--gold-light); font-size: 0.85rem; }
.sidebar-card .pm-section a { color: rgba(255,255,255,0.9); text-decoration: underline; }
.sidebar-card .pm-section a:hover { color: var(--gold-light); }

.sidebar-card .copyright {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    margin-top: 1rem;
}

/* ========== CONTENT ELEMENTS ========== */
.content-area p { margin-bottom: 1rem; }
.content-area p:last-child { margin-bottom: 0; }

.content-area h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem;
    color: var(--navy);
    margin: 1.75rem 0 0.75rem;
}

.content-area h2:first-child { margin-top: 0; }

.content-area h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy-light);
    margin: 1.25rem 0 0.5rem;
}

.section-divider {
    border: none;
    border-top: 2px solid var(--gray-200);
    margin: 1.75rem 0;
}

.content-link {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.content-link:hover { color: var(--link-hover); }

/* Info cards */
.info-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--navy);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
}

.info-card.highlight {
    border-left-color: var(--gold);
    background: #fdf8ee;
}

/* Feature grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.feature-item {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--gray-200);
    transition: box-shadow var(--transition);
}

.feature-item:hover { box-shadow: var(--shadow-md); }

.feature-item .icon { font-size: 2rem; margin-bottom: 0.5rem; }
.feature-item h4 { font-size: 0.9rem; color: var(--navy); margin-bottom: 0.25rem; }
.feature-item p { font-size: 0.82rem; color: var(--text-light); }

/* Contact table */
.contact-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1rem 0;
}

.contact-table th {
    background: var(--navy);
    color: var(--white);
    padding: 0.65rem 1rem;
    text-align: left;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.contact-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

.contact-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
}

.contact-table tr:nth-child(even) td { background: var(--gray-50); }
.contact-table tr:hover td { background: #eef3f8; }

.contact-table a { color: var(--link); text-decoration: underline; }

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 0.3rem;
    color: var(--gray-700);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26,39,68,0.1);
}

.form-group .required { color: var(--red-accent); }

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 0.25rem;
    accent-color: var(--navy);
}

.checkbox-group label {
    font-weight: 400;
    font-size: 0.88rem;
    margin-bottom: 0;
    cursor: pointer;
}

.checkbox-group .committee-desc {
    font-size: 0.9rem;
    color: var(--text-light);
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), transform 0.1s;
    font-family: inherit;
}

.btn:active { transform: scale(0.98); }

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}
.btn-secondary:hover { background: var(--gray-300); }

.btn-danger {
    background: var(--red-accent);
    color: var(--white);
}
.btn-danger:hover { background: var(--red-hover); color: var(--white); }

/* ========== DIRECTORY TABLE ========== */
.directory-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.directory-controls input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.directory-controls input:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26,39,68,0.1);
}

.directory-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

.directory-table th {
    background: var(--navy);
    color: var(--white);
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    position: sticky;
    top: 0;
}

.directory-table th:hover { background: var(--navy-light); }
.directory-table th .sort-arrow { margin-left: 0.3rem; opacity: 0.5; }
.directory-table th.sorted .sort-arrow { opacity: 1; }

.directory-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.directory-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

.directory-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: top;
}

.directory-table tr:nth-child(even) td { background: var(--gray-50); }
.directory-table tr:hover td { background: #eef3f8; }
.directory-table tr.hidden { display: none; }

.directory-count {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

/* ========== LOGIN FORM ========== */
.login-box {
    max-width: 380px;
    margin: 3rem auto;
    text-align: center;
}

.login-box .lock-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-box h2 {
    margin-bottom: 0.5rem;
}

.login-box p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.login-error {
    background: #fdeaea;
    color: var(--red-accent);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* ========== ADMIN ========== */
.admin-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--gray-200);
}

.admin-section:last-child { border-bottom: none; }

.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    background: var(--gray-50);
    margin: 1rem 0;
    transition: border-color var(--transition);
}

.upload-area:hover { border-color: var(--navy); }

.upload-area input[type="file"] {
    display: block;
    margin: 0.75rem auto 0;
}

.preview-table {
    max-height: 300px;
    overflow-y: auto;
    margin: 1rem 0;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.success-msg {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.error-msg {
    background: #fdeaea;
    color: var(--red-accent);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

/* Inline edit */
.edit-row td { background: #fffde7 !important; }
.edit-row input {
    width: 100%;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 3px;
    font-size: 0.82rem;
    font-family: inherit;
}

.action-btns {
    display: flex;
    gap: 0.3rem;
}

.action-btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

.action-btn.edit { background: #e3f2fd; color: #1565c0; }
.action-btn.delete { background: #fce4ec; color: #c62828; }
.action-btn.save { background: #e8f5e9; color: #2e7d32; }
.action-btn.cancel { background: var(--gray-200); color: var(--gray-700); }

/* ========== ALERT/FLASH MESSAGES ========== */
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.flash-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.flash-error { background: #fdeaea; color: #c0392b; border: 1px solid #f5c6cb; }

/* ========== FOOTER ========== */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.78rem;
    color: var(--gray-500);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 820px) {
    .page-wrapper {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .sidebar { position: static; }

    .content-area { padding: 1.5rem; }

    .nav-toggle { display: inline-block; }

    .main-nav {
        display: none;
        flex-direction: column;
        padding-bottom: 0.5rem;
    }

    .main-nav.open { display: flex; }

    .main-nav a {
        border-radius: var(--radius-sm);
        text-align: center;
    }

    .site-title { font-size: 1.3rem; }

    .directory-table { font-size: 0.78rem; }
    .directory-table th, .directory-table td { padding: 0.4rem 0.5rem; }
}

@media (max-width: 550px) {
    .contact-table th, .contact-table td { padding: 0.5rem 0.6rem; font-size: 0.82rem; }
    .feature-grid { grid-template-columns: 1fr; }
    .content-area { padding: 1.25rem; }
}

/* Yard Sale Image */
.yardsale-img {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.yardsale-img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

/* Mobile: stop floated images from squishing text */
@media (max-width: 550px) {
    .content-area img[style*="float"] {
        float: none !important;
        display: block;
        margin: 0 auto 1rem !important;
        width: 100% !important;
        max-width: 320px;
    }
}
