/**
 * 파일명: home.css
 * 파일경로: /home/majordom/events.kr/assets/css/home.css
 * 기능: 메인 페이지(index.php) 전용 스타일 — 히어로, 검색박스, 이벤트 카드/테이블, 소개·FAQ 섹션
 * 작성일: 2026-06-24
 * 수정일: 2026-08-26
 * 비고: index.php 인라인 <style> 블록에서 분리 (브라우저 캐싱 + ?v=filemtime 캐시 버스팅)
 */

/* ======== [1차] 메인 페이지 스타일 ======== */

/* ---- [2차] 히어로 섹션 ---- */
.hero-section {
    background: linear-gradient(135deg, #0db19e 0%, #3a66df 100%);
    color: white;
    padding: 40px 0;
    margin-bottom: -40px;
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.hero-lead {
    max-width: 780px;
    font-size: 1rem;
    line-height: 1.75;
    opacity: 0.95;
}

.hero-lead strong,
.hero-lead span {
    display: block;
}

/* ---- [2차] 검색 박스 ---- */
.search-box {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
    border-top: 4px solid;  /* 추가 */
    border-image: linear-gradient(135deg, #10a37f 0%, #5664d2 100%) 1;  /* 추가 */
}


/* ---- [2차] 특별 필터 버튼 ---- */
.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 20px;
    color: #495057;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #f8f9fa;
    border-color: #0d6efd;
    color: #0d6efd;
}

.filter-btn.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* ---- [2차] 기존 이벤트 카드 스타일 (공모전/설문용) ---- */
.event-card {
    transition: all 0.3s ease;
    border: none;
    height: 100%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    overflow: hidden;
    position: relative;
    background: white;
}

.event-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #10a37f 0%, #5664d2 100%);
    z-index: 1;
}

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

.event-category {
    background: linear-gradient(135deg, #10a37f 0%, #5664d2 100%);
    color: white;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.event-title {
    margin-bottom: 1rem;
}

.event-title a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.event-title a:hover {
    color: #10a37f;
}

.event-meta {
    border-top: 1px solid #f0f0f0;
    padding-top: 1rem;
    margin-top: auto;
}

.event-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #6c757d;
    transition: transform 0.2s ease;
}

.event-meta-item:hover {
    transform: translateX(5px);
    color: #495057;
}

.event-meta-item i {
    color: #10a37f;
    width: 18px;
    font-size: 1rem;
}

/* ---- [2차] 게시판 테이블 스타일 ---- */
.event-table-wrapper {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-top: 4px solid;
    border-image: linear-gradient(135deg, #10a37f 0%, #5664d2 100%) 1;
}

.event-table {
    margin-bottom: 0;
}

.event-table thead {
    background: #f8f9fa;
}

.event-table th {
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding: 1rem;
}

.event-table td {
    padding: 1rem;
    vertical-align: middle;
}

.event-table tbody tr {
    transition: background 0.2s;
}

.event-table tbody tr:hover {
    background: #f8f9fa;
}

.category-badge {
    background: #e7f3ff;
    color: #0066cc;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.deadline-badge {
    background: #fff3cd;
    color: #856404;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
}

.deadline-urgent {
    background: #f8d7da;
    color: #721c24;
}

.prize-tooltip {
    display: inline-block;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* ---- [2차] AEO 서비스 소개·FAQ 섹션 (카드형) ---- */
/* [3차] 브랜드 그라데이션 토큰 (로고 텍스트와 동일) */
.info-faq-section {
    --brand-gradient: linear-gradient(135deg, #1aad9e 0%, #1a6fd4 100%);
    position: relative;
    margin-top: 3rem;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem 1.75rem;
    overflow: hidden;
}
.info-faq-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-gradient);
}

/* [3차] 최종 업데이트 pill 뱃지 */
.info-faq-section .update-date {
    display: inline-block;
    margin-bottom: 1.75rem;
    padding: 0.25rem 0.75rem;
    background: #f1f3f5;
    border-radius: 999px;
    color: #868e96;
    font-size: 0.8rem;
}

/* [3차] 섹션 제목 / 본문 */
.info-faq-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}
.info-faq-section h2:not(:first-of-type) {
    margin-top: 2.25rem;
}
.info-faq-section p,
.info-faq-section li {
    color: #495057;
    line-height: 1.8;
    font-size: 0.97rem;
}

/* [3차] 응모 단계 — 번호 뱃지 (CSS 카운터) */
.info-faq-section .info-steps {
    list-style: none;
    padding-left: 0;
    counter-reset: step;
}
.info-faq-section .info-steps li {
    position: relative;
    margin-bottom: 0.75rem;
    padding-left: 2.5rem;
    counter-increment: step;
}
.info-faq-section .info-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    background: var(--brand-gradient);
    border-radius: 50%;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
}

/* [3차] FAQ — Q/A 마커 서브 카드 그리드 */
.faq-list {
    margin-top: 0.5rem;
    display: grid;
    gap: 0.75rem;
}
.faq-item {
    padding: 1.1rem 1.25rem;
    background: #f8f9fa;
    border: 1px solid #eef0f2;
    border-radius: 10px;
}
.faq-item h3,
.faq-item .faq-answer {
    position: relative;
    padding-left: 1.6rem;
}
.faq-item h3::before,
.faq-item .faq-answer::before {
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
}
.faq-item h3 {
    font-size: 1.02rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}
.faq-item h3::before {
    content: "Q";
    color: #1aad9e;
}
.faq-item .faq-answer {
    margin: 0;
    color: #6c757d;
    line-height: 1.75;
    font-size: 0.95rem;
}
.faq-item .faq-answer::before {
    content: "A";
    color: #1a6fd4;
}

/* 섹션 제목 스타일 추가 */
.section-title {
    position: relative;
    margin-bottom: 3rem;
    text-align: center;
}

.section-title h2 {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.section-title p {
    color: #6c757d;
    font-size: 1.1rem;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #10a37f 0%, #5664d2 100%);
    border-radius: 2px;
}

/* ---- [2차] 반응형 ---- */
@media (max-width: 768px) {
    .event-table {
        font-size: 0.85rem;
    }

    .event-table th, .event-table td {
        padding: 0.6rem 0.4rem;
    }

    .hide-mobile {
        display: none;
    }

    /* 카테고리 배지 모바일 축소 */
    .category-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }

    /* 이벤트명 2줄 제한 */
    .event-table .event-title-text {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* 응모 버튼 모바일 축소 */
    .event-table .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}


/* ======== [1차] 광고 카드 & 추천 리스트 (2026-08-23) ======== */
/* 유료 노출(프리미엄) 이벤트를 메인 최상단에 카드로 두고,
   추천 공모전·설문은 리스트로 축소해 시선을 양보한다.
   광고가 없을 때는 추천 섹션이 기존 카드형으로 되돌아간다(index.php 분기). */

/* ---- [2차] 프리미엄 광고 카드 ---- */
.ad-event-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #d7e3df;
    border-radius: 6px;
    overflow: hidden;
}

.ad-event-thumb {
    display: block;
    aspect-ratio: 16 / 9;
    background: #f5f6f7;
    overflow: hidden;
}

.ad-event-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 세로로 긴 홍보 이미지는 위쪽에 제목이 들어가는 경우가 많다.
       기본값(center)이면 가운데만 잘려 나오므로 위에서부터 보이도록 고정한다. */
    object-position: center top;
}

.ad-event-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 1rem;
}

.ad-event-top {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}

/* 광고 표기 배지 — 유료 노출 구분 표시. 임의로 숨기지 말 것 */
.ad-event-flag {
    flex: 0 0 auto;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.5;
    color: #8a6d00;
    background-color: #fff3cd;
    border: 1px solid #ffe08a;
    border-radius: 3px;
}

.ad-event-category {
    flex: 0 0 auto;
    padding: 0.1rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
    color: #0d7a5f;
    background-color: #eaf6f2;
    border-radius: 3px;
}

.ad-event-dday {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 0.1rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
    color: #495057;
    background-color: #f1f3f5;
    border-radius: 3px;
}

.ad-event-dday.is-urgent {
    color: #c62828;
    background-color: #fdecea;
}

.ad-event-host {
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.ad-event-title {
    margin: 0 0 0.6rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
}

.ad-event-title a {
    color: #2c3e50;
    text-decoration: none;
}

.ad-event-prize {
    margin-bottom: 0.9rem;
    font-size: 0.85rem;
    color: #198754;
}

/* ---- [2차] 추천 공모전·설문 리스트형 ---- */
.featured-list-head {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #10a37f;
}

.featured-list-description {
    color: #6c757d;
    font-size: 0.82rem;
}

.featured-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.featured-list-item + .featured-list-item {
    border-top: 1px solid #f1f3f5;
}

.featured-list-item a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    color: #333;
    text-decoration: none;
}

.featured-list-cat {
    flex: 0 0 auto;
    padding: 0.1rem 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #0d7a5f;
    background-color: #eaf6f2;
    border-radius: 3px;
}

.featured-list-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.92rem;
}

.featured-list-date {
    flex: 0 0 auto;
    font-size: 0.8rem;
    color: #6c757d;
}

@media (max-width: 767.98px) {
    /* [3차] 히어로 문구를 짧은 정보 단위로 분리해 가독성을 높인다 */
    .hero-section {
        padding: 1.65rem 0 3.5rem;
    }

    .hero-section .container {
        padding-right: 1.25rem;
        padding-left: 1.25rem;
    }

    .hero-title {
        margin-bottom: 0.45rem;
        font-size: 1.65rem;
        line-height: 1.3;
    }

    .hero-subtitle {
        display: none;
    }

    .hero-lead {
        max-width: 21rem;
        font-size: 0.84rem;
        line-height: 1.55;
    }

    .hero-lead strong {
        margin-bottom: 0.2rem;
        font-size: 0.86rem;
    }

    /* [3차] 메인 콘텐츠의 Bootstrap 기본 좌우 여백을 절반 수준으로 줄인다 */
    .main-content {
        --bs-gutter-x: 1rem;
    }

    .search-box {
        padding: 1rem 0.75rem;
        border-radius: 8px;
    }

    /* [3차] 추천 영역 제목과 설명이 좁은 폭에서 서로 밀리지 않게 세로 배치한다 */
    .featured-list-head {
        display: block;
        margin-bottom: 0.5rem;
    }

    .featured-list-head h2 {
        margin-bottom: 0.2rem !important;
        font-size: 1.05rem;
        line-height: 1.45;
        word-break: keep-all;
    }

    .featured-list-description {
        display: block;
        font-size: 0.78rem;
        line-height: 1.45;
    }

    .featured-list-item a {
        gap: 0.4rem;
        padding: 0.55rem 0.6rem;
    }

    .featured-list-cat {
        display: none;
    }

    .featured-list-title {
        font-size: 0.86rem;
    }

    .featured-list-date {
        font-size: 0.74rem;
    }

    /* [3차] 한 건을 두 줄로 나눈다 — 1행: 제목 전체 폭 / 2행: 마감일 · 응모형태 · 응모 버튼
       좁은 화면에서 제목이 쓸 수 있는 가로 폭을 최대한 확보하기 위한 구성이다. */
    .event-table,
    .event-table thead,
    .event-table tbody {
        display: block;
        width: 100%;
    }

    .event-table thead tr {
        display: block;
        width: 100%;
        background: #f8f9fa;
    }

    .event-table tbody tr.event-list-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        column-gap: 0.4rem;
        width: 100%;
        border-bottom: 1px solid #e9ecef;
    }

    /* 2행에 마감일과 응모형태가 함께 나오므로 헤더는 이벤트명만 남긴다 */
    .event-table .event-category-heading,
    .event-table .event-deadline-heading,
    .event-table .event-action-heading {
        display: none;
    }

    .event-table .event-name-heading {
        display: block;
        width: 100%;
        padding: 0.55rem 0.65rem;
    }

    .event-table tbody tr.event-list-row:last-child {
        border-bottom: 0;
    }

    /* 제목 칸의 자식(제목 묶음 · 마감일)을 그대로 그리드 항목으로 올린다 */
    .event-table .event-title-cell {
        display: contents;
    }

    /* [1행] 제목 — 좌우 전체 폭 사용 */
    .event-table .event-title-cell > div {
        grid-column: 1 / -1;
        grid-row: 1;
        min-width: 0;
        width: 100%;
        padding: 0.6rem 0.65rem 0.3rem;
    }

    /* [2행] 왼쪽: 마감일 */
    .event-table .event-mobile-deadline {
        grid-column: 1;
        grid-row: 2;
        align-self: center;
        min-width: 0;
        margin: 0;
        padding: 0 0.2rem 0.6rem 0.65rem;
    }

    /* [2행] 가운데: 응모형태 배지 */
    .event-table .event-category-cell {
        grid-column: 2;
        grid-row: 2;
        align-self: center;
        padding: 0 0.2rem 0.6rem;
        text-align: right;
        border-bottom: 0;
    }

    /* [2행] 오른쪽: 응모 버튼 */
    .event-table .event-action-cell {
        grid-column: 3;
        grid-row: 2;
        align-self: center;
        padding: 0 0.65rem 0.6rem 0.2rem;
        border-bottom: 0;
    }

    .event-table .category-badge {
        display: inline-block;
        max-width: 110px;
        overflow: hidden;
        padding: 0.18rem 0.4rem;
        font-size: 0.68rem;
        text-overflow: ellipsis;
        vertical-align: middle;
        white-space: nowrap;
    }

    .event-table .event-host {
        display: block;
        overflow: hidden;
        margin-bottom: 0.1rem;
        font-size: 0.75rem;
        line-height: 1.35;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .event-table .event-title-text {
        -webkit-line-clamp: 3;
        line-clamp: 3;
        font-size: 0.88rem;
        line-height: 1.4;
        word-break: keep-all;
    }

    .event-table .event-mobile-deadline {
        font-size: 0.72rem;
        line-height: 1.35;
        white-space: nowrap;
    }

    .event-table .event-action-cell .btn {
        min-width: 46px;
    }

    .event-table tbody tr.ad-row {
        display: block;
        width: 100%;
    }

    .event-table tbody tr.ad-row td {
        display: block;
        width: 100%;
    }

    /* [3차] container와 내부 카드에 중첩되던 소개·FAQ 좌우 패딩을 최소화한다 */
    .info-faq-section {
        margin-top: 2rem;
        padding: 1.35rem 0.2rem;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .info-faq-section .update-date {
        margin: 0 0.35rem 1.25rem;
    }

    .info-faq-section h2,
    .info-faq-section > p,
    .info-faq-section .info-steps {
        margin-right: 0.35rem;
        margin-left: 0.35rem;
    }

    .info-faq-section h2 {
        font-size: 1.22rem;
    }

    .info-faq-section h2:not(:first-of-type) {
        margin-top: 1.8rem;
    }

    .info-faq-section p,
    .info-faq-section li {
        font-size: 0.91rem;
        line-height: 1.72;
    }

    .info-faq-section .info-steps li {
        padding-left: 2.15rem;
    }

    .faq-list {
        gap: 0.6rem;
    }

    .faq-item {
        padding: 0.85rem 0.65rem;
        border-radius: 8px;
    }

    .faq-item h3,
    .faq-item .faq-answer {
        padding-left: 1.35rem;
    }

    .faq-item h3 {
        font-size: 0.94rem;
        line-height: 1.5;
    }

    .faq-item .faq-answer {
        font-size: 0.88rem;
        line-height: 1.7;
    }
}
