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

/* Base styles */
html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9f9f9;
    line-height: 1.6;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    background-color: #0d1b4c;
    color: #fff;
    padding: 20px;
    text-align: center;
}

header h1 a {
    color: #fff;
    text-decoration: none;
    font-size: 2rem;
    font-weight: bold;
}

/* Hamburger button */
.menu-toggle {
    display: none;
    font-size: 2rem;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: #0d1b4c;
    color: #ffdd57;
    border: none;
    padding: 0.5rem 0.7rem;
    border-radius: 6px;
    z-index: 1000;
}

.page-subtitle {
    text-align: left;
    font-size: 1.2rem;
    color: #555;
    margin-top: 10px;
    margin-bottom: 30px;
    font-style: italic;
}

/* Navigation */
nav {
    margin-top: 10px;
}

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

.nav-links a {
    color: #ffdd57;
    margin: 0 8px;
    text-decoration: none;
    font-weight: bold;
}

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

/* Main container */
main {
    max-width: 1000px;
    margin: 30px auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    flex: 1;
    width: 90%;
}

/* Testimonials grid */
ul.testimonials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    list-style: none;
    padding: 0;
}

ul.testimonials li {
    background-color: #fdfdfd;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    transition: transform 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

ul.testimonials li:hover {
    transform: translateY(-5px);
}

ul.testimonials li h2 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #0d1b4c;
}

ul.testimonials li .meta {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 12px;
}

/* Preview: truncate long content */
ul.testimonials li .preview {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    font-size: 0.95rem;
    color: #555;
    margin-bottom: auto;
}

/* Testimonial header with image */
.testimonial-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.testimonial-thumb {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-left: 10px;
    border: 1px solid #ddd;
}

/* Link to full testimonial */
ul.testimonials li a.read-more {
    margin-top: 15px;
    align-self: flex-start;
    color: #0d1b4c;
    font-weight: bold;
    text-decoration: none;
}

ul.testimonials li a.read-more:hover {
    text-decoration: underline;
}

/* Testimonial detail */
.testimonial-detail img {
    max-width: 100%;
    border-radius: 10px;
    margin: 15px 0;
}

.image-container {
    margin: 20px 0;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}

/* Django messages */
.messages {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.messages li {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-weight: 500;
}

.messages li.success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.messages li.error {
    background-color: #f8d7da;
    color: #842029;
}

.help-text {
  font-size: 0.875rem;
  color: #555;
}

/* Pending approval notice */
.pending-approval {
    background-color: #f8d7da;
    color:  #842029;
    border: 1px solid #fcdfe1;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* Forms */
form {
    margin-top: 20px;
    background-color: #fefefe;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

form input,
form textarea,
form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

form button {
    background-color: #0d1b4c;
    color: #fff;
    padding: 8px 18px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

form button:hover {
    background-color: #07133a;
}

/* Logout button */
.logout-form {
    display: inline;
    margin-left: 10px;
}

.logout-btn {
    all: unset;
    background: none;
    color: #0d1b4c;
    border: none;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    line-height: 1;
    display: inline-block;
    height: auto;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.logout-btn:hover {
    background-color: #f8f6f6;
    color: #0d1b4c;
    text-decoration: none;
}

/* Back button */
.back-link {
    margin-top: 20px;
    text-align: right;
}

.back-link a {
    color: #0d1b4c;
    text-decoration: none;
    font-weight: bold;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Button link */
.btn-link {
    display: inline-block;
    background-color: #555;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn-link:hover {
    background-color: #464545;
    text-decoration: none;
}

/* Footer */
footer {
    text-align: center;
    color: #555;
    font-size: 0.9rem;
    padding: 30px 15px 15px;
    background-color: #f1f1f1;
    border-top: 1px solid #ddd;
}

/* Responsive design */
@media (max-width: 768px) {
    main {
        padding: 20px;
    }

    ul.testimonials {
        grid-template-columns: 1fr;
    }

    header h1 a {
        font-size: 1.5rem;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .logout-form {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 0.95rem;
    }

    header h1 a {
        font-size: 1rem;
    }

    footer {
        font-size: 0.85rem;
    }

    form button {
        width: 100%;
    }
}

@media (min-width: 1400px) {
    html, body {
        display: flex;
        justify-content: center;
    }

    body > * {
        width: 100%;
        max-width: 1200px;
    }
}