/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Pretendard', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background-color: #fafbfc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Header */
.site-header {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e8ecef;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    max-height: 70px;
}

.logo a {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a73e8;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.main-nav {
    position: relative;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #2c3e50;
    cursor: pointer;
    padding: 8px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

.nav-menu li a {
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: block;
}

.nav-menu li a:hover {
    background: #f1f5f9;
    color: #1a73e8;
}

/* 조회수 스타일 */
.view-count-wrapper {
    color: #6b7280;
    font-size: 0.9rem;
}

.view-count {
    color: #6b7280;
    font-size: 0.85rem;
}

.view-count i {
    margin-right: 4px;
}

.board-meta .view-count {
    margin-left: 12px;
}

/* Main Content */
.main-content {
    padding: 48px 0;
    min-height: calc(100vh - 200px);
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 24px;
}

.breadcrumb a {
    color: #1a73e8;
    text-decoration: none;
}

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

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 48px;
}

.page-header h1 {
    font-size: 2rem;
    color: #1a202c;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-header .subtitle {
    font-size: 1rem;
    color: #718096;
    font-weight: 400;
}

/* Quick Links */
.quick-links {
    margin-bottom: 40px;
}

.link-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.quick-link-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #ffffff;
    color: #1a73e8;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.quick-link-btn:hover {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.15);
}

/* Region Filter Links */
.region-filters {
    margin-bottom: 40px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.region-filters h2 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #1a202c;
    font-weight: 600;
}

.filter-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.filter-links a {
    padding: 10px 16px;
    background: #f8fafc;
    color: #4a5568;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.filter-links a:hover {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
    transform: translateY(-1px);
}

/* Fair Grid */
.fair-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.loading, .empty-message, .error-message {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 1rem;
    grid-column: 1 / -1;
}

/* Wedding Post Card */
.wedding-post {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
}

.wedding-post:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.post-image-container {
    position: relative;
    width: 100%;
    padding-top: 66.67%;
    overflow: hidden;
    background: #f8fafc;
}

.post-image-container a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

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

.wedding-post:hover .post-image {
    transform: scale(1.05);
}

.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fair-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a202c;
    margin: 8px 0;
    line-height: 1.4;
    min-height: 44px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-text {
    color: #718096;
    font-size: 0.875rem;
}

.invitation-link {
    display: block;
    padding: 12px 20px;
    background: #1a73e8;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.invitation-link:hover {
    background: #1557b0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.25);
}

/* Calendar Styles */
.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8ecef;
}

.calendar-header h2 {
    font-size: 1.4rem;
    color: #1a202c;
    font-weight: 600;
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-nav button {
    padding: 8px 16px;
    background: white;
    color: #1a73e8;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.calendar-nav button:hover {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #4a5568;
}

.calendar-day {
    min-height: 100px;
    padding: 12px;
    border: 1px solid #e8ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-day:hover {
    background: #f8fafc;
    border-color: #1a73e8;
    transform: translateY(-1px);
}

.calendar-day.has-event {
    background: #eff6ff;
    border-color: #93c5fd;
}

.calendar-day.has-event:hover {
    background: #dbeafe;
    border-color: #1a73e8;
}

.calendar-day .date {
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a202c;
}

.calendar-day .events {
    font-size: 0.8rem;
    color: #1a73e8;
}

/* Calendar Overlay */
.calendar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.calendar-overlay.active {
    display: flex;
}

.calendar-popup {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
}

.calendar-popup h3 {
    font-size: 1.3rem;
    color: #1a202c;
    margin-bottom: 20px;
    font-weight: 600;
}

.calendar-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #718096;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.calendar-popup-close:hover {
    background: #f1f5f9;
    color: #1a202c;
}

.calendar-event-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calendar-event-item {
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e8ecef;
    transition: all 0.2s;
}

.calendar-event-item:hover {
    background: #eff6ff;
    border-color: #1a73e8;
}

.calendar-event-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.calendar-event-item h4 {
    font-size: 1rem;
    color: #1a202c;
    margin-bottom: 8px;
    font-weight: 600;
}

.calendar-event-item p {
    font-size: 0.875rem;
    color: #718096;
    margin: 4px 0;
}

/* Board Styles */
.board-container {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.board-list {
    list-style: none;
}

.board-item {
    padding: 20px;
    border-bottom: 1px solid #e8ecef;
    transition: background 0.2s;
}

.board-item:last-child {
    border-bottom: none;
}

.board-item:hover {
    background: #f8fafc;
}

.board-item a {
    text-decoration: none;
    color: inherit;
}

.board-title {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: #1a202c;
}

.board-meta {
    font-size: 0.85rem;
    color: #718096;
    display: flex;
    gap: 16px;
}

/* Footer */
.site-footer {
    background: #1a202c;
    color: white;
    padding: 48px 0 24px;
    margin-top: 80px;
    border-top: 1px solid #2d3748;
}

.footer-content {
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.footer-links a {
    color: #e2e8f0;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #90cdf4;
}

.copyright {
    color: #a0aec0;
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .site-header .container {
        padding: 12px 20px;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 16px;
        gap: 0;
        display: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu li a {
        padding: 14px 16px;
        display: block;
        border-radius: 8px;
    }

    .page-header h1 {
        font-size: 1.6rem;
    }

    .page-header .subtitle {
        font-size: 0.9rem;
    }

    .fair-grid {
        grid-template-columns: 1fr;
    }

    .filter-links {
        grid-template-columns: repeat(2, 1fr);
    }

    .calendar-grid {
        gap: 4px;
    }

    .calendar-day {
        min-height: 80px;
        padding: 8px;
        font-size: 0.85rem;
    }

    .calendar-popup {
        padding: 24px;
        margin: 20px;
    }

    .calendar-container {
        padding: 20px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .fair-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .fair-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}