/* 
 * Gallery Page Styles
 * Hair Salon Picasso
 */

/* ===== GLOBAL STYLES ===== */
:root {
    --primary-color: #A9976D;
    --secondary-color: #333333;
    --light-color: #F9F8F5;
    --text-color: #000;
    --text-light: #777777;
    --transition: all 0.4s ease;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    font-family: "orpheuspro", serif;
    color: var(--text-color);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    font-size: 15px;
    font-weight: 300;
    letter-spacing: 0.05em;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "orpheuspro", serif;
    font-style: normal;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.03em;
}

a {
    color: var(--secondary-color);
    transition: var(--transition);
}

a:hover, a:focus {
    color: var(--primary-color);
    text-decoration: none;
}

.button {
    background-color: var(--primary-color);
    color: white;
    border-radius: 2px;
    font-weight: 400;
    padding: 0.85em 2.2em;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--transition);
    font-size: 12px;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

.button:hover, .button:focus {
    background-color: var(--secondary-color);
    color: white;
}

.button.secondary {
    background-color: var(--secondary-color);
}

.button.secondary:hover, .button.secondary:focus {
    background-color: var(--primary-color);
}

/* ===== HEADER & NAVIGATION ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px 0;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.site-header.scrolled {
    padding: 12px 0;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-logo {
    padding: 0 15px;
}

.header-logo img {
    max-height: 40px;
    width: auto;
}

.main-navigation {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
}

.main-navigation ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
}

.main-navigation li {
    margin-left: 20px;
    position: relative;
}

.main-navigation a {
    color: var(--secondary-color);
    font-size: 13px;
    font-weight: 400;
    padding: 10px 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    font-family: "orpheuspro", serif;
    font-style: normal;
    text-decoration: none;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

.main-navigation a.current {
    color: var(--primary-color);
}

.main-navigation a::before {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--primary-color);
    transition: var(--transition);
    opacity: 0;
}

.main-navigation a:hover::before,
.main-navigation a.current::before {
    width: 100%;
    opacity: 1;
}

.header-reserve {
    margin-left: 20px;
}

.header-reserve .button {
    padding: 0.5em 1.5em;
    margin: 0;
    color: #fff;
}

.mobile-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.mobile-buttons .button {
    padding: 0.5em 1em;
    margin-left: 10px;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 20px;
    margin-left: 15px;
    padding: 0;
    width: 30px;
}

.menu-toggle span {
    background-color: var(--secondary-color);
    display: block;
    height: 2px;
    transition: var(--transition);
    width: 100%;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.mobile-menu {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 100vh;
    left: 0;
    opacity: 0;
    padding: 80px 20px 20px;
    position: fixed;
    top: 0;
    transform: translateX(100%);
    transition: var(--transition);
    width: 100%;
    z-index: 999;
}

.mobile-menu.active {
    opacity: 1;
    transform: translateX(0);
}

.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu li {
    margin-bottom: 15px;
}

.mobile-menu a {
    color: var(--secondary-color);
    display: block;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
}

.mobile-menu a:hover {
    color: var(--primary-color);
}

/* ===== PAGE HEADER ===== */
.page-header {
    background: linear-gradient(135deg, var(--light-color) 0%, #F5F3E9 100%);
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
    margin-top: 80px;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)),
                url('https://images.unsplash.com/photo-1560066984-138dadb4c035?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
}

.page-title {
    font-family: "orpheuspro", serif;
    font-size: 3.5rem;
    font-weight: 400;
    margin-bottom: 1rem;
    color: #fff;
    position: relative;
    letter-spacing: 2px;
}

.page-subtitle {
    font-size: 1.1rem;
    color: #fff;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* ===== BREADCRUMB ===== */
.breadcrumb-section {
    background: white;
    padding: 20px 0;
    border-bottom: 1px solid #E8E8E8;
}

.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 14px;
    margin: 0;
    padding: 0;
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb-separator {
    margin: 0 10px;
    color: var(--text-light);
}

.breadcrumb .current {
    color: var(--text-color);
    font-weight: 500;
}

/* ===== INSTAGRAM ACCOUNTS SECTION ===== */
.instagram-accounts-section {
    padding: 60px 0;
    background: white;
}

.instagram-accounts-section h2 {
    font-family: "orpheuspro", serif;
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 3rem;
    color: var(--text-color);
    letter-spacing: 1px;
}

.instagram-account-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.instagram-account-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(135deg, #FF6B9D, #C44569);
}

.instagram-account-card.hair-account::before {
    background: linear-gradient(135deg, var(--primary-color), #D4AF37);
}

.instagram-account-card.eyelash-account::before {
    background: linear-gradient(135deg, #FF6B9D, #C44569);
}

.instagram-account-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.account-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    transition: var(--transition);
}

.instagram-account-card:hover .account-icon {
    transform: scale(1.1) rotate(5deg);
}

.account-info h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
    font-family: "orpheuspro", serif;
}

.account-info p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 1rem;
}

.account-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
}

.stat-item {
    font-size: 0.9rem;
    color: var(--text-light);
}

.stat-item strong {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.account-info .button {
    background: linear-gradient(135deg, #405de6, #833ab4);
    border: none;
    padding: 12px 30px;
    font-weight: 500;
    border-radius: 25px;
    transition: var(--transition);
}

.account-info .button:hover {
    background: linear-gradient(135deg, #833ab4, #405de6);
    transform: scale(1.05);
}

.account-info .button i {
    margin-right: 8px;
}

/* ===== GALLERY FILTER SECTION ===== */
.gallery-filter-section {
    background-color: var(--light-color);
    padding: 30px 0;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 80px;
    z-index: 100;
}

.gallery-filters {
    margin-bottom: 20px;
}

.filter-tabs {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-tab {
    background: white;
    border: 2px solid #ddd;
    border-radius: 25px;
    padding: 12px 25px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.filter-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.filter-tab i {
    font-size: 16px;
}

.gallery-sort {
    text-align: right;
}

.gallery-sort label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--secondary-color);
}

.gallery-sort select {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 15px;
    font-size: 14px;
    background-color: white;
    transition: var(--transition);
    width: 100%;
}

.gallery-sort select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(169, 151, 109, 0.2);
}

.gallery-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.gallery-count {
    font-size: 16px;
    color: var(--text-light);
}

.gallery-count span {
    font-weight: 700;
    color: var(--primary-color);
}

.view-toggle {
    display: flex;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    overflow: hidden;
}

.view-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    padding: 8px 15px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
}

/* ===== GALLERY SECTION ===== */
.gallery-section {
    padding: 60px 0 80px;
    background: #FAFAFA;
}

.gallery-container {
    transition: var(--transition);
}

/* ===== MASONRY LAYOUT (修正版) ===== */
.gallery-container.masonry-view {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
}

.gallery-container.masonry-view .gallery-item {
    flex: 0 0 calc(33.333% - 14px);
    min-width: 300px;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .gallery-container.masonry-view .gallery-item {
        flex: 0 0 calc(50% - 10px);
        min-width: 250px;
    }
}

@media (max-width: 480px) {
    .gallery-container.masonry-view .gallery-item {
        flex: 0 0 100%;
        min-width: 200px;
    }
}

.gallery-container.masonry-view .gallery-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== GRID LAYOUT ===== */
.gallery-container.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-gap: 20px;
}

.gallery-container.grid-view .gallery-post {
    height: 400px !important;
}

.gallery-container.grid-view .gallery-post .post-image {
    height: 300px !important;
}

/* ===== GALLERY ITEMS ===== */
.gallery-item {
    margin-bottom: 20px;
    opacity: 1;
    transition: all 0.8s ease;
}

.gallery-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    height: 0;
    overflow: hidden;
    margin: 0;
}

.gallery-post {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transition: var(--transition);
    position: relative;
}

.gallery-post:hover {
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

/* ===== POST SIZES (masonry用) ===== */
.gallery-container.masonry-view .gallery-post.small {
    height: 350px;
}

.gallery-container.masonry-view .gallery-post.medium {
    height: 450px;
}

.gallery-container.masonry-view .gallery-post.large {
    height: 550px;
}

.gallery-container.masonry-view .gallery-post.small .post-image {
    height: 250px;
}

.gallery-container.masonry-view .gallery-post.medium .post-image {
    height: 350px;
}

.gallery-container.masonry-view .gallery-post.large .post-image {
    height: 450px;
}

/* ===== POST COMPONENTS ===== */
.post-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.post-image {
    position: relative;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-post:hover .post-image img {
    transform: scale(1.1);
}

.post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0.3) 70%,
        rgba(0,0,0,0.6) 100%
    );
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.gallery-post:hover .post-overlay {
    opacity: 1;
}

.post-stats {
    display: flex;
    gap: 20px;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.likes-count, .comments-count {
    display: flex;
    align-items: center;
    gap: 5px;
}

.likes-count i {
    color: #ff3040;
}

.comments-count i {
    color: #ffffff;
}

.post-info {
    padding: 20px;
    background: white;
}

.post-account {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 14px;
    margin-bottom: 10px;
}

.post-account i {
    color: #405de6;
    font-size: 16px;
}

.post-tags {
    font-size: 13px;
    color: var(--primary-color);
    line-height: 1.4;
}

/* ===== HASHTAG SECTION ===== */
.hashtag-section {
    padding: 80px 0;
    background: white;
}

.hashtag-section h2 {
    font-family: "orpheuspro", serif;
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 1rem;
    color: var(--text-color);
    letter-spacing: 1px;
}

.hashtag-section p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 3rem;
}

.hashtag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.hashtag-link {
    background: var(--light-color);
    color: var(--secondary-color);
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border: 2px solid transparent;
}

.hashtag-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(169, 151, 109, 0.3);
}

.hashtag-link.popular {
    background: var(--primary-color);
    color: white;
    font-size: 16px;
    padding: 12px 25px;
    border-color: var(--primary-color);
}

.hashtag-link.popular:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(51, 51, 51, 0.3);
}

/* ===== LOAD MORE BUTTON ===== */
.load-more-btn {
    margin-top: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 30px;
    padding: 1em 3em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transition: left 0.5s ease;
}

.load-more-btn:hover::before {
    left: 0;
}

.load-more-btn i,
.load-more-btn span {
    position: relative;
    z-index: 1;
}

.load-more-btn i {
    margin-right: 10px;
}

.load-more-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.load-more-btn.loading i {
    animation: spin 1s linear infinite;
}

/* ===== GALLERY CTA ===== */
.gallery-cta {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    text-align: center;
}

.gallery-cta h2 {
    font-family: "orpheuspro", serif;
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 15px;
    color: white;
}

.gallery-cta p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.7;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cta-buttons .button {
    min-width: 200px;
    padding: 1em 2.5em;
    font-size: 16px;
    border-radius: 30px;
    font-weight: 500;
}

.cta-buttons .button.secondary {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.cta-buttons .button.secondary:hover {
    background: white;
    color: var(--primary-color);
}

.cta-buttons .button.secondary i {
    margin-right: 8px;
}

/* ===== FOOTER ===== */
.site-footer {
    background-color: var(--primary-color);
    color: white;
    padding: 80px 0 0;
}

.footer-info {
    margin-bottom: 30px;
}

.footer-logo {
    margin-bottom: 20px;
}

.footer-logo img {
    max-height: 60px;
    width: auto;
}

.footer-tagline {
    font-size: 16px;
    margin-bottom: 20px;
}

.footer-address {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.footer-social {
    display: flex;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    margin-right: 10px;
    transition: var(--transition);
    text-decoration: none;
}

.footer-social a:hover {
    background-color: var(--secondary-color);
}

.footer-links {
    margin-bottom: 30px;
}

.footer-links h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: white;
    position: relative;
    padding-bottom: .25em;
    border-bottom: solid 1px;
}

.footer-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    transition: var(--transition);
    text-decoration: none;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    margin-top: 30px;
}

.footer-policy {
    margin-bottom: 20px;
}

.footer-policy ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

.footer-policy li {
    margin-right: 20px;
    margin-bottom: 10px;
}

.footer-policy a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    transition: var(--transition);
    text-decoration: none;
}

.footer-policy a:hover {
    color: white;
}

.footer-copyright {
    text-align: right;
}

.footer-copyright p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--secondary-color);
}

.back-to-top a {
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

/* Stagger animation delays for gallery items */
.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }
.gallery-item:nth-child(9) { animation-delay: 0.9s; }
.gallery-item:nth-child(10) { animation-delay: 1.0s; }
.gallery-item:nth-child(11) { animation-delay: 1.1s; }
.gallery-item:nth-child(12) { animation-delay: 1.2s; }

/* Reset animation delay for items beyond 12 */
.gallery-item:nth-child(n+13) { animation-delay: 0s; }

/* ===== RESPONSIVE STYLES ===== */
@media screen and (max-width: 63.9375em) {
    .page-title {
        font-size: 2.5rem;
    }

    .instagram-accounts-section h2,
    .hashtag-section h2,
    .gallery-cta h2 {
        font-size: 1.8rem;
    }

    .instagram-account-card {
        padding: 30px 20px;
    }

    .account-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
        margin-bottom: 20px;
    }

    .account-stats {
        gap: 20px;
    }

    .filter-tabs {
        justify-content: center;
    }

    .gallery-sort {
        text-align: left;
        margin-top: 20px;
    }

    .gallery-info {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .gallery-container.masonry-view .gallery-item {
        flex: 0 0 calc(50% - 10px);
        min-width: 250px;
    }

    .gallery-container.grid-view {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        grid-gap: 15px;
    }

    .gallery-container.masonry-view .gallery-post.small,
    .gallery-container.masonry-view .gallery-post.medium,
    .gallery-container.masonry-view .gallery-post.large {
        height: 350px;
    }

    .gallery-container.masonry-view .gallery-post.small .post-image,
    .gallery-container.masonry-view .gallery-post.medium .post-image,
    .gallery-container.masonry-view .gallery-post.large .post-image {
        height: 250px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons .button {
        width: 100%;
        max-width: 300px;
    }
}

@media screen and (max-width: 39.9375em) {
    .page-header {
        padding: 120px 0 60px;
    }

    .page-title {
        font-size: 2rem;
    }

    .instagram-accounts-section {
        padding: 40px 0;
    }

    .instagram-accounts-section h2 {
        font-size: 1.6rem;
        margin-bottom: 2rem;
    }

    .instagram-account-card {
        padding: 25px 15px;
    }

    .account-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .account-info h3 {
        font-size: 1.2rem;
    }

    .account-info p {
        font-size: 0.9rem;
    }

    .account-stats {
        flex-direction: column;
        gap: 10px;
    }

    .gallery-filter-section {
        padding: 20px 0;
    }

    .filter-tabs {
        gap: 8px;
    }

    .filter-tab {
        padding: 8px 15px;
        font-size: 12px;
    }

    .filter-tab span {
        display: none;
    }

    .gallery-section {
        padding: 40px 0 60px;
    }

    .gallery-container.masonry-view .gallery-item {
        flex: 0 0 100%;
        min-width: 200px;
    }

    .gallery-container.grid-view {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        grid-gap: 10px;
    }

    .gallery-post {
        border-radius: 10px;
    }

    .gallery-container.masonry-view .gallery-post.small,
    .gallery-container.masonry-view .gallery-post.medium,
    .gallery-container.masonry-view .gallery-post.large {
        height: 300px;
    }

    .gallery-container.masonry-view .gallery-post.small .post-image,
    .gallery-container.masonry-view .gallery-post.medium .post-image,
    .gallery-container.masonry-view .gallery-post.large .post-image {
        height: 200px;
    }

    .post-info {
        padding: 15px;
    }

    .hashtag-section {
        padding: 60px 0;
    }

    .hashtag-section h2 {
        font-size: 1.6rem;
    }

    .hashtag-section p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .hashtag-cloud {
        gap: 8px;
    }

    .hashtag-link {
        padding: 8px 15px;
        font-size: 12px;
    }

    .hashtag-link.popular {
        padding: 10px 18px;
        font-size: 14px;
    }

    .gallery-cta {
        padding: 60px 0;
    }

    .gallery-cta h2 {
        font-size: 1.6rem;
    }

    .gallery-cta p {
        font-size: 1rem;
    }

    .footer-copyright {
        text-align: left;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .gallery-post,
    .post-image img,
    .filter-tab,
    .hashtag-link,
    .gallery-item {
        transition: none !important;
        animation: none !important;
    }

    .gallery-post:hover {
        transform: none !important;
    }
}

/* Focus styles for accessibility */
.gallery-post:focus,
.filter-tab:focus,
.hashtag-link:focus,
.view-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gallery-post,
    .instagram-account-card {
        border: 2px solid;
    }

    .filter-tab,
    .hashtag-link {
        border-width: 2px;
    }
}

/* ===== SEARCH HIGHLIGHTING ===== */
.search-highlight {
    background: rgba(169, 151, 109, 0.3);
    padding: 1px 2px;
    border-radius: 2px;
}

/* ===== LOADING STATES ===== */
.gallery-item.loading {
    opacity: 0.5;
    pointer-events: none;
}

.gallery-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(169, 151, 109, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    z-index: 10;
}

/* ===== SPECIAL EFFECTS ===== */
.gallery-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(169, 151, 109, 0.1),
        transparent
    );
    transition: left 0.8s ease;
    z-index: 1;
}

.gallery-post:hover::before {
    left: 100%;
}

/* ===== PRINT STYLES ===== */
@media print {
    .gallery-section {
        background: white !important;
        padding: 20px 0;
    }

    .gallery-post {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
        margin-bottom: 20px;
    }

    .gallery-filter-section,
    .gallery-cta,
    .load-more-btn {
        display: none;
    }

    .page-header {
        padding: 40px 0 20px;
        background: white !important;
    }

    .gallery-container.masonry-view,
    .gallery-container.grid-view {
        display: block;
        columns: 3;
        column-gap: 20px;
    }

    .gallery-item {
        break-inside: avoid;
        margin-bottom: 20px;
    }
}

/* ===== CUSTOM SCROLLBAR ===== */
.gallery-container::-webkit-scrollbar {
    width: 8px;
}

.gallery-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.gallery-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.gallery-container::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}