/* --- 全体基本設定 --- */
body {
    font-family: sans-serif;
    margin: 0;
    background: #f7f7f7;
    color: #333;
}

/* ラベル類を1つに統合：画像の下に必ず隙間を作る設定 */
.license-label, .license-type, .license {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* --- HERO HEADER --- */
.hero {
    height: 320px;
    background-image: url("images/hero.jpg");
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-inner {
    background: rgba(255,255,255,0.8);
    padding: 40px;
    border-radius: 12px;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 10px;
}

.hero h1 a {
    color: black;
    text-decoration: none;
}

.hero p {
    font-size: 18px;
    margin: 0;
}
.sub-title {
  font-size: 14px;
  color: #666;
  margin-top: 6px;
}

/* --- SEARCH --- */
#search-form {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.trust-bar {
  font-size: 12px;
  color: #888;
  margin-top: 6px;
}
#search-input {
    padding: 10px 14px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
    width: 260px;
}

#search-form button {
    padding: 10px 16px;
    border: none;
    background: #333;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}

#search-form button:hover {
    background: #555;
}

/* --- MAIN LAYOUT --- */
.container {
    display: grid;
    grid-template-columns: 220px 1fr 200px;
    gap: 30px;
    max-width: 1800px; /* 1400から1800へ広げる */
    margin: auto;
    padding: 20px;
}

/* --- SIDEBAR --- */
.sidebar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    height: fit-content;
}

.sidebar h2 {
    margin-top: 0;
}

.sidebar a{
    display:inline-block;
    padding:6px 12px;
    margin:4px;
    border-radius:5px;
    background:#f3f4f6;
    text-decoration:none;
}

.sidebar a:hover {
    text-decoration: underline;
}

/* --- GALLERY (ここが修正の肝です) --- */
.gallery {
    display: block; 
    column-count: 4; /* 3から4へ変更 */
    column-gap: 15px;
    width: 100%;
}
/* 画像とテキストを「絶対に分離させない」セットの箱 */
.photo-card {
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    box-sizing: border-box;
    break-inside: avoid; /* 画像と下の文字が別々の列に泣き別れするのを防ぐ */
    transition: transform .25s ease;
    position: relative;
}

.photo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.photo-card img {
    width: 100%;
    height: auto; /* 縦横の比率を維持 */
    display: block;
    border-radius: 5px;
}

/* --- PHOTO PAGE & OTHER COMPONENTS --- */
.photo-container {
    max-width: 900px;
    margin: auto;
    padding: 40px;
    text-align: center;
}
.photo-container h1 a {
    color: black;
    text-decoration: none;
}

.photo-container img {
    max-width: 100%;
    border-radius: 8px;
}

.download-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 24px;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 6px;
}

#description {
    margin-top: 20px;
    line-height: 1.6;
    color: #555;
}

.support-btn {
    display: block;
    width: fit-content;
    margin: 12px auto 25px;
    padding: 8px 14px;
    font-size: 14px;
    background: #ffdd00;
    color: #000;
    text-decoration: none;
    border-radius: 20px;
    font-weight: bold;
}

.support-btn:hover {
    opacity: 0.9;
}

.support-text {
    text-align: center;
    margin: 16px 0 8px;
    font-size: 15px;
    color: #555;
}

/* =========================
   DOWNLOAD表示（ホバー）
========================= */

/* ラベルを表示するために親要素を基準にする */
.photo-card {
    position: relative; 
}

/* 黒い「Free Download」ラベルの作成 */
.photo-card::after {
    content: "Free Download";
    position: absolute;
    /* 位置の調整：画像の上に重なるように配置 */
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    pointer-events: none; /* マウス操作を邪魔しない */
    opacity: 0;           /* 最初は消しておく */
    transition: 0.3s;     /* ふわっと出す */
    z-index: 10;
}

/* ホバーした時だけ表示する */
.photo-card:hover::after {
    opacity: 1;
}

.footer {
    margin-top: 60px;
    padding: 20px;
    text-align: center;
    font-size: 14px;
    color: #666;
    border-top: 1px solid #eee;
}

.footer a {
    color: #666;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}


/* --- RESPONSIVE (レスポンシブ設定) --- */
@media screen and (max-width: 1600px) {
    .gallery {
        column-count: 3; /* 画面が少し狭くなったら3列に戻す */
    }
}

@media screen and (max-width: 1200px) {
    .container {
        grid-template-columns: 220px 1fr; 
    }
    .gallery {
        column-count: 2; /* さらに狭くなったら2列に */
    }
}

@media screen and (max-width: 800px) {
    .container {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 600px) {
    .gallery {
        column-count: 1; /* スマホでは1列 */
    }
}
.photo-tags{
margin-top:20px;
display:flex;
flex-wrap:wrap;
gap:8px;
}


.tag-button{

display:inline-block;

padding:6px 12px;

border-radius:20px;

background:#eee;

color:#333;

text-decoration:none;

font-size:13px;

transition:.2s;

}


.tag-button:hover{

background:#333;

color:white;

}
