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

body{
    font-family:Arial,Helvetica,sans-serif;
    background:#f5f7fa;
    color:#222;
    line-height:1.6;
}

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

header h1{
    font-size:2rem;
}

header p{
    color:#cbd5e1;
    margin-top:8px;
}

/* ===== Search ===== */
.search-box{
    max-width:900px;
    margin:25px auto;
    padding:0 20px;
}

#search{
    width:100%;
    padding:14px;
    border:1px solid #ddd;
    border-radius:8px;
    font-size:16px;
    background: #fff;
    max-width: 900px;
    margin: 25px auto;
    display: block;
}

/* ===== Gallery ===== */
#gallery{
    max-width:1400px;
    margin:auto;
    padding:20px;
    display:grid;
    grid-template-columns: repeat(auto-fill,minmax(320px,1fr));
    gap:22px;
}

/* ===== Card ===== */
article{
    background:#fff;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 4px 15px rgba(0,0,0,.08);
    transition:.3s;
    display: flex;
    flex-direction: column;
}

article:hover{
    transform:translateY(-5px);
}

/* ===== Images ===== */
figure {
    margin: 0;
    background: #fff;
}

img,
video{
    width:100%;
    display:block;
    aspect-ratio:16/9;
    object-fit:cover;
}

/* ===== Caption ===== */
figcaption{
    padding:18px;
    background: #fff;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

figcaption h2{
    font-size:20px;
    margin-bottom:10px;
    color:#111;
}

figcaption h2 a {
    color: inherit;
    text-decoration: none;
}

figcaption h2 a:hover {
    color: #2563eb;
}

figcaption p{
    color:#555;
    margin-bottom:12px;
}

small{
    color:#777;
    display:block;
    margin-top: auto;
}

/* ===== Buttons ===== */
button{
    background:#2563eb;
    color:white;
    border:none;
    padding:10px 18px;
    border-radius:6px;
    cursor:pointer;
    transition:.3s;
}

button:hover{
    background:#1d4ed8;
}

/* ===== Footer ===== */
footer{
    text-align:center;
    padding:30px;
    color:#777;
    font-size:14px;
}

/* ===== Responsive ===== */
@media(max-width:768px){
    header h1{
        font-size:1.6rem;
    }
    #gallery{
        grid-template-columns:1fr;
    }
}
