/*
 * Kamwezi School: extras for pages built with Elementor.
 * Colours, fonts, spacing and photos are set in each Elementor widget (Style tab),
 * so staff can change them. This file only adds what the Elementor panel cannot:
 * hover effects, gallery captions and the text inside rich-text boxes.
 */
.kw-elementor-main { display: block; }
.kw-elementor-main .elementor-heading-title a { color: inherit; }

/* Cards lift on hover */
.kw-card { transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.kw-card:hover { transform: translateY(-7px); }

/* Photo tiles (home): frame line on hover */
.kw-tile { position: relative; overflow: hidden; text-decoration: none; }
.kw-tile::after { position: absolute; inset: 12px; z-index: 2; border: 1px solid rgba(255,255,255,.45); content: ''; opacity: 0; transition: opacity .22s ease; pointer-events: none; }
.kw-tile:hover::after { opacity: 1; }
.kw-tile > .elementor-element, .kw-tile .e-con-inner > .elementor-element { position: relative; z-index: 3; }
@media (min-width: 768px) and (max-width: 1024px) { .kw-tile-wide { grid-column: 1 / -1; } }

/* School life links: yellow arrow, line between rows */
.kw-life-link { text-decoration: none; transition: background-color .2s ease; }
.kw-life-link:hover { background-color: #fffbea; }
.kw-life-link b { margin-left: 14px; color: #f4df00; font-size: 1.25em; }

/* Rich text boxes on inner pages */
.kw-content h2 { margin: 44px 0 0; font-size: 31px; }
.kw-content h2:first-child { margin-top: 0; }
.kw-content h3 { margin-top: 30px; font-size: 23px; }
.kw-content ul { padding-left: 24px; }
.kw-content .notice { padding: 20px 24px; border-left: 4px solid #f4df00; background: #fff8d9; }
.kw-content a { text-decoration: underline; }

/* Gallery: photo cards with the caption on the picture */
.kw-gallery .gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0 !important; }
.kw-gallery .gallery-columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kw-gallery .gallery-columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kw-gallery .gallery br { display: none; }
.kw-gallery .gallery-item { position: relative; overflow: hidden; width: auto !important; max-width: none !important; min-height: 260px; margin: 0 !important; padding: 0 !important; border: 1px solid #dde5f0; background: #0a1029; box-shadow: 0 14px 30px rgba(10,16,41,.1); }
.kw-gallery .gallery-icon, .kw-gallery .gallery-icon a { display: block; height: 100%; }
.kw-gallery .gallery-item img { display: block; width: 100%; height: 260px !important; object-fit: cover; border: 0 !important; transition: transform .35s ease; }
.kw-gallery .gallery-item:hover img { transform: scale(1.04); }
.kw-gallery .gallery-caption { position: absolute; right: 0; bottom: 0; left: 0; margin: 0; padding: 45px 18px 16px; background: linear-gradient(transparent, rgba(6,11,28,.9)); color: #fff; font-size: 14px; font-weight: 700; text-align: left; pointer-events: none; }

@media (max-width: 1024px) {
    .kw-gallery .gallery, .kw-gallery .gallery-columns-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .kw-gallery .gallery, .kw-gallery .gallery-columns-2, .kw-gallery .gallery-columns-4 { grid-template-columns: 1fr; }
    .kw-gallery .gallery-item, .kw-gallery .gallery-item img { min-height: 230px; height: 230px !important; }
}
@media (prefers-reduced-motion: reduce) {
    .kw-card, .kw-gallery .gallery-item img { transition: none; }
    .kw-card:hover { transform: none; }
}
