/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Permanent+Marker&display=swap');

/* Ensure the header is at the top and above other content */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #fff; 
}

/* Add padding to the top of the blog container */
#blog-container {
    padding-top: 100px; /* Adjust this value based on your header height */
}

/* Ensure the blog content doesn't overlap the header */
#controls-container, #polaroid-grid {
    position: relative;
    z-index: 1;
}

/* Right menu icons should also be above the blog content */


/* General Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f7a6c82d;
}

#blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.blog-header {
    line-height: 1.6;
    margin: 0;
    padding: 120px 0 0;
}

h1 {
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Meiryo', sans-serif;
    font-size: 2.2rem;
    background: linear-gradient(90deg, #ffb187, #e521d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    letter-spacing: 1px;
    padding: 1.5rem 0 1rem;
    word-break: break-all;
    line-height: 1.2;
    white-space: normal;
}

/* Controls Container Styles */
#controls-container {
    display: flex;
    justify-content: center;
    gap: 80px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    background-color: #ffffff8f; /* Light background for contrast */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); /* Soft shadow */
}

#sort-container, #filter-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

/* Hide the sort container */
#sort-container {
    display: none;
}

/* Adjust the layout after hiding the sort container */
#controls-container {
    display: flex;
    justify-content: flex-end; /* This will push the filter to the right */
}

/* Give more space to the filter after hiding the sort options */
#filter-container {
    width: 100%;
}
/* Modern Label Style */
label {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-right: 10px;
}

/* Modern Dropdown Style */
select {
    padding: 12px 18px;
    border: none;
    border-radius: 10px; /* Rounded corners */
    background-color: #fff;
    color: #333;
    font-size: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Light shadow */
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="#333" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    transition: all 0.3s ease;
}

select:hover, select:focus {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); /* More emphasis on hover/focus */
    outline: none;
}

/* Larger Dropdowns for Mobile */
@media (max-width: 600px) {
    select {
        width: 100%; /* Full width on mobile */
        padding: 14px;
    }
    #controls-container {
        flex-direction: column; /* Stack vertically on mobile */
        gap: 10px;
    }
}

/* Improve the look of the filter containers on mobile */
@media (max-width: 900px) {
    #sort-container, #filter-container {
        flex-direction: column;
        margin-bottom: 10px;
        gap: 10px;
        width: 100%;
    }
}


/* Polaroid Grid Styles */
#polaroid-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* Polaroid Styles */
.polaroid-container {
    perspective: 1000px;
    margin-bottom: 90px;
    cursor: pointer;
}

.polaroid {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 5px;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 15px 15px 20px 15px;
    position: relative;
    transform: rotate(-0deg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
}

.polaroid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.1);
    transform: translateZ(-10px);
    z-index: -1;
}

.polaroid::after {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    width: 80px;
    height: 25px;
    background-color: rgba(255,255,255,0.5);
    transform: translateX(-50%) rotate(-2deg);
    opacity: 0.7;
    box-shadow: 0 0 3px rgba(0,0,0,0.1);
}

.polaroid:nth-child(even) {
    transform: rotate(2deg);
}

.polaroid:hover {
    transform: rotate(-2deg) translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 2;
}

.polaroid-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background-color: #f0f0f0;
    position: relative;
}

.polaroid-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.polaroid-title {
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Meiryo', sans-serif;
    font-size: 1.1rem;
    color: #333;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 0;
    word-break: break-all;
    line-height: 1.3;
    white-space: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.6em;
    height: 2.6em;
}

.polaroid-subtitle {
    text-align: center;
    font-size: 12px;
    color: #666;
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
}

.polaroid-subtitle a {
    color: #FF70AB;
    font-size: 1.2rem;
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Meiryo', sans-serif;
    text-decoration: none;
}

.polaroid-date, .polaroid-model {
    margin: 0;
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Meiryo', sans-serif;
    font-size: 0.95rem;
    color: #666;
    text-align: center;
}

/* Popup Styles */
#popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#popup-container.hidden {
    display: none;
}

#popup-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

#close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
}

#popup-content h2 {
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Meiryo', sans-serif !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #FF70AB !important;
    line-height: 1.3;
    letter-spacing: 0.01em;
}

#popup-content a {
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Meiryo', sans-serif !important;
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    color: #FF70AB !important;
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-decoration: none !important;
}

#popup-content a:hover {
    text-decoration: underline !important;
}

#popup-content img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.popup-info {
    font-style: italic;
    color: #666;
    margin-bottom: 10px;
}

/* Loading Overlay Styles */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-overlay p {
    margin-top: 20px;
    font-size: 18px;
    color: #333;
}

/* End Message Styles */
#end-message {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #666;
    font-weight: bold;
}

.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    #polaroid-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    #polaroid-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .polaroid-title {
        font-size: 1rem;
        min-height: 2.2em;
        height: 2.2em;
    }
    .polaroid-date, .polaroid-model {
        font-size: 0.85rem;
    }
    h1 {
        font-size: 1.5rem;
        padding: 1rem 0 0.7rem;
    }
}

@media (max-width: 600px) {
    #blog-container {
        padding: 10px;
    }

    /* Pulldown menu styling */
    #controls-container {
        flex-direction: column;
        gap: 10px;
    }

    #sort-container, #filter-container {
        width: 100%;
    }

    label {
        display: block;
        margin-bottom: 5px;
        font-weight: bold;
    }

    select {
        width: 100%;
        padding: 10px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #fff;
        font-size: 16px;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
        background-repeat: no-repeat;
        background-position: right 10px top 50%;
        background-size: 20px auto;
    }

    /* Polaroid styling for mobile */
    #polaroid-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px;
    }

    .polaroid-container {
        margin-bottom: 60px;
    }

    .polaroid {
        width: 80%;
        max-width: 300px;
        margin: 0 auto;
        aspect-ratio: 1 / 1;
        padding: 15px 15px 30px 15px;
    }

    .polaroid-image {
        height: calc(100% - 60px);
    }

    .polaroid-title {
        font-size: 0.95rem;
        min-height: 2em;
        height: 2em;
    }

    .polaroid-date, .polaroid-model {
        font-size: 0.8rem;
    }

    h1 {
        font-size: 1.1rem;
        padding: 0.7rem 0 0.5rem;
    }
}

/* --- Responsive popup header and link styles (smaller, balanced) --- */
@media (max-width: 900px) {
  #popup-content h2 {
    font-size: 1.1rem !important;
  }
}
@media (max-width: 600px) {
  #popup-content h2 {
    font-size: 1rem !important;
  }
}