/* =========================================================
   写真ダウンロードページ専用スタイル
   既存セレクタと重複しないよう接頭辞 dl- を付与
   ========================================================= */

.dl-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    min-height: 60vh;
    box-sizing: border-box;
}

/* ----- 共通ボタン ----- */
.dl-btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 15px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.25s, opacity 0.25s;
    font-family: inherit;
}

.dl-btn-primary {
    background-color: #FF9900;
    color: #fff;
}

.dl-btn-primary:hover {
    background-color: #e88a00;
}

.dl-btn-ghost {
    background-color: transparent;
    color: #FF9900;
    border: 2px solid #FF9900;
}

.dl-btn-ghost:hover {
    background-color: #fff3e0;
}

.dl-btn-sm {
    padding: 7px 12px;
    font-size: 13px;
}

.dl-btn-block {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
}

.dl-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ----- ログイン画面 ----- */
.dl-login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.dl-login-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    padding: 32px 28px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-sizing: border-box;
}

.dl-login-title {
    color: #FF9900;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.dl-login-desc {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.dl-login-error {
    background-color: #ffe6e6;
    color: #c0392b;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.dl-login-lock {
    color: #c0392b;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.dl-login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dl-login-input {
    padding: 12px 14px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    width: 100%;
    transition: border-color 0.25s;
}

.dl-login-input:focus {
    outline: none;
    border-color: #FF9900;
}

/* ----- 一覧画面 ----- */
.dl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    padding: 16px 18px;
    margin-bottom: 20px;
}

.dl-toolbar-info {
    margin: 0;
    color: #555;
    font-size: 0.95em;
}

.dl-empty {
    text-align: center;
    color: #888;
    padding: 30px 0;
}

.dl-folder {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 16px;
    overflow: hidden;
}

.dl-folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    flex-wrap: wrap;
}

.dl-folder-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.05em;
    text-align: left;
    color: #333;
    padding: 4px;
    width: auto;
}

.dl-folder-name {
    font-weight: bold;
}

.dl-folder-count {
    background-color: #fff3e0;
    color: #e88a00;
    font-size: 0.8em;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.dl-folder-arrow {
    color: #FF9900;
    transition: transform 0.25s;
    margin-left: auto;
}

.dl-folder-toggle[aria-expanded="true"] .dl-folder-arrow {
    transform: rotate(180deg);
}

.dl-folder-body {
    padding: 0 16px 16px;
    border-top: 1px solid #f0f0f0;
}

.dl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.dl-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    background-color: #fafafa;
}

.dl-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: #f0f0f5;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.dl-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dl-thumb-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background-color: #000;
}

.dl-thumb-ext {
    font-weight: bold;
    color: #FF9900;
    font-size: 1.1em;
    letter-spacing: 1px;
}

.dl-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

.dl-card-name {
    font-size: 0.85em;
    color: #333;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dl-card-size {
    font-size: 0.78em;
    color: #999;
}

.dl-back-link {
    text-align: center;
    margin-top: 24px;
}

.dl-back-link a {
    color: #FF9900;
    text-decoration: none;
    font-weight: bold;
}

.dl-back-link a:hover {
    text-decoration: underline;
}

/* ----- レスポンシブ（スマホは写真を1行1枚に） ----- */
@media (max-width: 768px) {
    .dl-main {
        padding: 12px;
    }

    .dl-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .dl-thumb {
        aspect-ratio: auto;
        max-height: 70vh;
    }

    .dl-thumb img {
        object-fit: contain;
    }

    .dl-folder-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dl-folder-header .dl-btn {
        width: 100%;
    }
}
