/* ============================================================
   CARROLLTON CLASS OF 1971 WEBSITE
   Main Stylesheet
   ============================================================ */

* {
    box-sizing: border-box;
}

/* ------------------------------------------------------------
   PAGE
   ------------------------------------------------------------ */

body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f4f6;
    color: #222;
    line-height: 1.5;
}

/* ------------------------------------------------------------
   HEADER
   ------------------------------------------------------------ */

header {
    background: #1f2937;
    color: white;
    padding: 20px;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

header h1 {
    margin: 0;
    font-size: 28px;
}

header p {
    margin: 5px 0 0;
    color: #d1d5db;
}

/* ------------------------------------------------------------
   NAVIGATION
   ------------------------------------------------------------ */

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 6px;
}

nav a:hover {
    background: #374151;
}

/* ------------------------------------------------------------
   MAIN CONTENT
   ------------------------------------------------------------ */

main {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

h1 {
    margin-top: 0;
}

h2 {
    margin-top: 0;
}

h3 {
    margin-bottom: 8px;
}

.subtitle {
    color: #666;
}

/* ------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------ */

footer {
    text-align: center;
    padding: 35px 20px;
    color: #666;
}

/* ------------------------------------------------------------
   FLASH MESSAGES
   ------------------------------------------------------------ */

.flash {
    background: #fff3cd;
    border: 1px solid #ffe69c;
    color: #664d03;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 6px;
}

/* ------------------------------------------------------------
   GENERAL CARDS
   ------------------------------------------------------------ */

.form-card,
.profile-card,
.card {
    background: white;
    padding: 25px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ------------------------------------------------------------
   FORMS
   ------------------------------------------------------------ */

.form-card label {
    display: block;
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 6px;
}

.form-card input,
.form-card textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    background: white;
}

.form-card input:focus,
.form-card textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* ------------------------------------------------------------
   CHECKBOXES
   ------------------------------------------------------------ */

.checkbox-label {
    font-weight: normal !important;
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.checkbox-label input {
    width: auto !important;
    margin: 0;
}

/* ------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------ */

button,
.button {
    display: inline-block;
    background: #2563eb;
    color: white !important;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    font-size: 15px;
    margin-top: 15px;
    opacity: 1;
}

button:hover,
.button:hover {
    background: #1d4ed8;
    color: white !important;
}

/* Delete / danger buttons */

button.danger,
.danger {
    background: #dc2626 !important;
    color: white !important;
}

button.danger:hover,
.danger:hover {
    background: #b91c1c !important;
    color: white !important;
}

/* ------------------------------------------------------------
   INLINE FORMS
   ------------------------------------------------------------ */

.inline-form {
    display: inline-block;
    margin: 0 5px 5px 0;
}

.inline-form button {
    margin-top: 0;
}

/* ------------------------------------------------------------
   CLASS DIRECTORY
   ------------------------------------------------------------ */

.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

/* ------------------------------------------------------------
   CLASSMATE DIRECTORY CARD
   ------------------------------------------------------------ */

.classmate-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.classmate-card:hover {
    color: inherit;
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.15);
}

/* ------------------------------------------------------------
   CLASSMATE PHOTO

   IMPORTANT:
   Do not use object-fit: cover here.
   That was cutting off the top and bottom of portrait photos.
   ------------------------------------------------------------ */

.classmate-photo {
    width: 100%;
    background: #eeeeee;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    line-height: 0;
}

.classmate-photo img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

/* ------------------------------------------------------------
   PROFILE PHOTO PLACEHOLDER
   ------------------------------------------------------------ */

.profile-placeholder {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: #777;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    line-height: normal;
}

/* ------------------------------------------------------------
   CLASSMATE INFORMATION
   ------------------------------------------------------------ */

.classmate-info {
    padding: 16px;
}

.classmate-info h2 {
    margin: 0 0 8px 0;
    font-size: 21px;
    color: #222;
}

.former-name {
    color: #666;
    font-size: 14px;
    margin-bottom: 6px;
}

.location {
    color: #555;
    font-size: 14px;
}

/* ------------------------------------------------------------
   DIRECTORY PAGE HEADER
   ------------------------------------------------------------ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.page-header h1 {
    margin-bottom: 4px;
}

.muted {
    color: #777;
}

/* ------------------------------------------------------------
   EMPTY DIRECTORY
   ------------------------------------------------------------ */

.empty-state {
    text-align: center;
    padding: 50px 20px;
    background: #f5f5f5;
    border-radius: 12px;
    margin-top: 25px;
}

.empty-state h2 {
    margin-bottom: 10px;
}

/* ------------------------------------------------------------
   ORIGINAL DIRECTORY CARD SUPPORT
   ------------------------------------------------------------ */

.directory-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    min-height: 180px;
}

.directory-card h2 {
    margin-top: 0;
    margin-bottom: 12px;
}

.directory-card p {
    margin: 8px 0;
}

/* ------------------------------------------------------------
   PROFILE
   ------------------------------------------------------------ */

.profile-card h2 {
    margin-top: 0;
}

.profile-card h3 {
    margin-top: 25px;
}

.privacy-note {
    color: #777;
    font-size: 14px;
    margin-top: 10px;
}

/* ------------------------------------------------------------
   CLASSMATE PROFILE PAGE
   ------------------------------------------------------------ */

.profile-page-header {
    margin-bottom: 20px;
}

.classmate-profile {
    max-width: 850px;
    margin: 0 auto 25px auto;
}

/* ------------------------------------------------------------
   LARGE PROFILE PHOTO
   ------------------------------------------------------------ */

.profile-photo-section {
    text-align: center;
    margin-bottom: 25px;
}

.profile-photo-large {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid #e5e7eb;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.profile-photo-placeholder {
    width: 220px;
    height: 220px;
    margin: 0 auto;
    border-radius: 50%;
    background: #777;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 90px;
    font-weight: bold;
    border: 5px solid #e5e7eb;
}

/* ------------------------------------------------------------
   PROFILE INFORMATION
   ------------------------------------------------------------ */

.profile-information {
    max-width: 650px;
    margin: 0 auto;
}

.profile-field {
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
}

.profile-label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    color: #777;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.profile-value {
    display: block;
    font-size: 17px;
    color: #222;
}

.profile-value a {
    color: #2563eb;
    text-decoration: none;
}

.profile-value a:hover {
    text-decoration: underline;
}

/* ------------------------------------------------------------
   ABOUT CLASSMATE
   ------------------------------------------------------------ */

.profile-about {
    margin-top: 25px;
    padding-top: 5px;
}

.profile-about h3 {
    margin-bottom: 10px;
}

.profile-about p {
    white-space: pre-wrap;
    line-height: 1.7;
}

/* ------------------------------------------------------------
   PROFILE ACTIONS
   ------------------------------------------------------------ */

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.profile-actions .button {
    margin-top: 0;
}

/* ------------------------------------------------------------
   POSTS
   ------------------------------------------------------------ */

.post-date {
    color: #777;
    font-size: 13px;
    margin-top: -8px;
}

.profile-card > p {
    white-space: pre-wrap;
}

/* ------------------------------------------------------------
   COMMENTS
   ------------------------------------------------------------ */

.comments {
    margin-top: 20px;
    padding-left: 20px;
    border-left: 3px solid #ddd;
}

.comment {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.comment:last-child {
    border-bottom: none;
}

.comment p {
    margin: 5px 0;
}

.comment-date {
    color: #777;
    font-size: 12px;
    margin-left: 8px;
}

/* ------------------------------------------------------------
   COMMENT FORM
   ------------------------------------------------------------ */

.profile-card form {
    margin-top: 15px;
}

.profile-card form input[type="text"] {
    width: 75%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
}

.profile-card form input[type="text"]:focus {
    outline: none;
    border-color: #2563eb;
}

/* ------------------------------------------------------------
   LINKS
   ------------------------------------------------------------ */

a {
    color: #2563eb;
}

a:hover {
    color: #1d4ed8;
}

/* ------------------------------------------------------------
   TABLES
   ------------------------------------------------------------ */

.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f3f4f6;
    font-weight: bold;
}

tr:hover {
    background: #fafafa;
}

/* ------------------------------------------------------------
   STATUS LABELS
   ------------------------------------------------------------ */

.status-admin {
    color: white;
    background: #374151;
    padding: 5px 9px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
}

.status-approved {
    color: white;
    background: #16a34a;
    padding: 5px 9px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
}

.status-pending {
    color: white;
    background: #d97706;
    padding: 5px 9px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
}

/* ------------------------------------------------------------
   MOBILE PHONE DISPLAY
   ------------------------------------------------------------ */

@media (max-width: 700px) {

    header {
        padding: 15px;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    header h1 {
        font-size: 23px;
    }

    nav {
        width: 100%;
        gap: 5px;
    }

    nav a {
        background: #374151;
        padding: 8px 10px;
        font-size: 14px;
    }

    main {
        margin-top: 20px;
        padding: 0 12px;
    }

    .form-card,
    .profile-card,
    .card {
        padding: 18px;
    }

    .directory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    /*
       Do NOT give directory photos a fixed height.
       This keeps portrait photos completely visible.
    */

    .classmate-photo {
        height: auto;
        min-height: 0;
        aspect-ratio: auto;
    }

    .classmate-photo img {
        width: 100%;
        height: auto;
        max-height: none;
        object-fit: contain;
    }

    .classmate-info {
        padding: 10px;
    }

    .classmate-info h2 {
        font-size: 17px;
    }

    .profile-card form input[type="text"] {
        width: 100%;
    }

    button,
    .button {
        padding: 10px 14px;
    }

    /* Mobile classmate profile */

    .classmate-profile {
        padding: 18px;
    }

    .profile-photo-large,
    .profile-photo-placeholder {
        width: 170px;
        height: 170px;
    }

    .profile-photo-placeholder {
        font-size: 70px;
    }

    .profile-actions {
        flex-direction: column;
    }

    .profile-actions .button {
        width: 100%;
        text-align: center;
    }

    /* Make admin table usable on phones */

    .table-container {
        overflow-x: auto;
    }

    th,
    td {
        white-space: nowrap;
    }
}

/* ------------------------------------------------------------
   VERY SMALL PHONES
   ------------------------------------------------------------ */

@media (max-width: 400px) {

    .directory-grid {
        grid-template-columns: 1fr;
    }

    .classmate-photo {
        height: auto;
        min-height: 0;
    }

    .classmate-photo img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}