/* =========================================
   UK DIVE TRAINING
   COURSES PAGE STYLESHEET (courses.html)
   Load after style.css
   ========================================= */

/* SECTION HEADING */

.section-heading {
    margin-bottom: 40px;
}

.section-heading p {
    max-width: 600px;
}

/* Course cards: image beside the information */
.course-grid {
    display: grid;
    grid-template-columns: 1fr;   /* one card per row so there's room for image + text */
    gap: 25px;
}

.modern-card {
    padding: 35px;
    border: 1px solid #dce7ec;
    border-radius: 10px;
    background: white;
    box-shadow: 0 8px 30px #061b2c0b;
    transition: .2s;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 35px;
    align-items: stretch;
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px #061b2c15;
}

.modern-card h3 {
    color: var(--navy);
}

.price {
    font-size: 19px;
    font-weight: 800;
    color: var(--blue);
    margin-top: 20px;
}

.course-image {
    min-height: 220px;
    background: #e5eef2;
    border: 2px dashed var(--blue);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    color: var(--blue);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    overflow: hidden;
}

.course-image span {
    display: block;
}

.course-image small {
    display: block;
    font-weight: 400;
    color: var(--text-muted);
    font-size: 13px;
}

/* Once a real image is in, drop the placeholder styling */
.course-image:has(img) {
    padding: 0;
    border: 0;
}

.course-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.course-details h3 {
    margin-top: 8px;
}

/* Image credits on course cards */
.course-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
}

.course-figure .course-image {
    flex: 1;
}

.course-figure figcaption {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
}

.course-figure figcaption a {
    color: var(--blue);
    text-decoration: underline;   /* links shouldn't rely on colour alone */
}

/* SDI SPECIALITIES */

.speciality-section {
    background: var(--background);
}

/* Speciality list (a real <ul>, so screen readers announce the item count) */
.speciality-grid {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 35px 0 0;
}

.speciality-grid li {
    background: white;
    border-radius: 5px;
    font-weight: 600;
    font-size: 14px;
}

/* The whole tile is the link, giving a large click/tap target */
.speciality-grid a {
    display: block;
    padding: 17px;
    color: var(--navy);
    text-decoration: none;
}

.speciality-grid a:hover {
    color: var(--blue);
    text-decoration: underline;
}

/* RESPONSIVE */

@media (max-width: 800px) {
    .modern-card {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .course-image {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .speciality-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .speciality-grid {
        grid-template-columns: 1fr;
    }
}

/* Respect users who have asked for less motion */
@media (prefers-reduced-motion: reduce) {
    .modern-card:hover {
        transform: none;
    }
}
