/* Global Styles & Typography */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #292b2f;
    color: #f5f5f5;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

a {
    color: #7289da;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 { /* Applied to all heading levels for consistency */
    color: #ffffff;
}

/* Header */
header {
    background-color: #23272a;
    padding: 1em 0;
    text-align: center;
    border-bottom: 2px solid #7289da;
}

header h1 {
    margin: 0;
    font-size: 2.5em;
    color: #7289da;
}

/* Main Content */
main {
    padding: 1em;
    max-width: 1200px;
    margin: 0 auto;
}

/* Sections */
section {
    margin-bottom: 2em;
    padding: 1em;
    background-color: #36393f;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

section h2 { /* Specific styling for section titles */
    border-bottom: 1px solid #4f545c;
    padding-bottom: 0.5em;
    margin-top: 0;
}

/* Filter Section */
#filters {
    margin-bottom: 1em;
}

#filters h2 {
    margin-bottom: 1em;
}

#filters h3 { /* Styling for filter subheadings */
    margin: 0.5em 0;
    font-size: 1.1em;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    padding: 0.5em 0;
}

#clear-filters-button {
    padding: 0.5em 1em;
    background-color: #7289da;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#clear-filters-button:hover {
    background-color: #5b6eae;
}

/* Tag Buttons */
.tag-button {
    padding: 0.3em 0.7em;
    background-color: #4f545c;
    color: #eAEAEA;
    border: 1px solid #7289da;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.tag-button:hover {
    background-color: #5b6eae;
    color: white;
    border-color: #5b6eae;
}

.tag-button.active {
    background-color: #7289da;
    color: white;
    font-weight: bold;
    border-color: #7289da;
}

/* Item Listings */
#shops-container,
#individuals-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1em;
}

/* Cards */
.shop-card,
.individual-card {
    background-color: #2c2f33; /* Slightly darker than section for contrast */
    border: 1px solid #4f545c;
    border-radius: 6px;
    padding: 1em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex; /* Added for better internal alignment */
    flex-direction: column; /* Added for better internal alignment */
}

.shop-card img,
.individual-card img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 0.5em;
    object-fit: cover; /* Ensures images cover the area, might need height constraints */
    aspect-ratio: 16/9; /* Example aspect ratio, adjust as needed */
}

.shop-card img {
  width: 100%;
  max-width: 300px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #222; /* 画像が小さい場合の背景色 */
}

.shop-card h3,
.individual-card h3 {
    margin-top: 0;
    margin-bottom: 0.5em; /* Added margin */
    color: #7289da;
    font-size: 1.3em; /* Slightly larger for card titles */
}

.shop-card p,
.individual-card p {
    margin-bottom: 0.5em; /* Consistent paragraph spacing */
    font-size: 0.95em;
}

.address { /* Class for address text within cards */
    font-size: 0.9em;
    color: #b9bbbe;
    margin-bottom: 0.5em;
}

/* Tags within cards (if rendered - currently rendered as text) */
.shop-card .tags,
.individual-card .tags {
    font-size: 0.85em;
    color: #b9bbbe;
    margin-top: auto; /* Pushes tags to the bottom if card is flex column */
    padding-top: 0.5em; /* Space above tags */
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5em 0; /* Increased padding */
    margin-top: 2em;
    background-color: #23272a;
    color: #b9bbbe;
    border-top: 1px solid #4f545c;
}

footer p {
    margin: 0.3em 0; /* Spacing for footer paragraphs */
}

/* Basic Responsiveness */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    #filters {
        /* flex-direction: column; */
        /* align-items: stretch; */
    }

    #filters div[id^="tag-filters-"] { /* Target both tag filter containers */
        width: 100%; /* Make tag containers full width */
    }

    .tag-container {
        justify-content: center; /* Center tags on smaller screens */
    }

    #shops-container,
    #individuals-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Adjust minmax for smaller screens */
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px; /* Slightly smaller base font for very small screens */
    }
    header h1 {
        font-size: 1.8em;
    }
    .shop-card h3,
    .individual-card h3 {
        font-size: 1.2em;
    }
    #shops-container,
    #individuals-container {
        grid-template-columns: 1fr; /* Single column layout on very small screens */
    }
}

/* Styles for shop-detail.html */
#shop-detail-container {
    background-color: #36393f; /* ダークテーマに統一 */
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#shop-detail-container h2 {
    color: #7289da; /* トップページの見出し色に合わせる */
}

#shop-detail-container img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 15px;
}

#shop-detail-container,
#shop-detail-container * {
    color: #e0e0e0 !important;
}

#shop-detail-container a {
    color: #7289da !important;
    text-decoration: underline;
}

#shop-detail-container a:hover {
    color: #aab8f3 !important;
}

#shop-individuals-container {
    background-color: #36393f; /* ダークテーマに統一 */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

#shop-individuals-container h2 {
    color: #7289da; /* トップページの見出し色に合わせる */
    border-bottom: 1px solid #4f545c;
    padding-bottom: 0.5em;
    margin-top: 0;
}

#shop-individuals-container,
#shop-individuals-container * {
    color: #e0e0e0 !important;
}

#individuals-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1em;
}

#individuals-list .individual-card {
    background-color: #2c2f33;
    border: 1px solid #4f545c;
    border-radius: 6px;
    padding: 1em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: #e0e0e0 !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#individuals-list .individual-card h3 {
    margin-top: 0;
    margin-bottom: 0.5em;
    color: #7289da !important;
    font-size: 1.3em;
}

#individuals-list .individual-card img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 0.5em;
    object-fit: cover;
    aspect-ratio: 16/9;
}

#individuals-list .individual-card p {
    margin-bottom: 0.5em;
    font-size: 0.95em;
}

#individuals-list .individual-card .tags {
    font-size: 0.85em;
    color: #b9bbbe !important;
    margin-top: auto;
    padding-top: 0.5em;
}
