/* 태라 갤러리 - Premium Minimal Style */

.tg-wrap {
    font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: #fff;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
}

/* ===== HERO ===== */
.tg-hero {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 160px 24px 100px;
    margin-top: -100px;
    text-align: center;
    overflow: hidden;
}

/* 배경 패턴 */
.tg-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(183,110,121,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(107,123,77,0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(196,112,77,0.1) 0%, transparent 40%);
}

/* 플로팅 아트 조각들 */
.tg-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* 떠다니는 도형들 */
.tg-hero-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.tg-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    filter: blur(1px);
}

.tg-shape-1 {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #B76E79 0%, #e8a5ad 100%);
    top: 20%;
    left: 10%;
    animation: tg-float 8s ease-in-out infinite;
}

.tg-shape-2 {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #6B7B4D 0%, #a5b58d 100%);
    top: 60%;
    right: 15%;
    animation: tg-float 6s ease-in-out infinite reverse;
}

.tg-shape-3 {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #C4704D 0%, #e8a882 100%);
    bottom: 30%;
    left: 25%;
    animation: tg-float 10s ease-in-out infinite;
}

.tg-shape-4 {
    width: 40px;
    height: 40px;
    background: #fff;
    opacity: 0.3;
    top: 40%;
    right: 30%;
    animation: tg-float 7s ease-in-out infinite;
}

@keyframes tg-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

/* 붓터치 장식 */
.tg-brush {
    position: absolute;
    opacity: 0.15;
}

.tg-brush-1 {
    top: 15%;
    left: 5%;
    width: 200px;
}

.tg-brush-2 {
    bottom: 20%;
    right: 5%;
    width: 180px;
    transform: rotate(180deg);
}

.tg-hero-inner {
    position: relative;
    z-index: 10;
    max-width: 600px;
    margin: 0 auto;
}

.tg-hero-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-bottom: 20px;
}

.tg-hero-title {
    font-size: 2.8rem;
    font-weight: 300;
    color: #fff;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.tg-hero-desc {
    font-size: 1rem;
    color: rgba(255,255,255,0.6);
    margin: 0;
    font-weight: 300;
}

/* ===== MAIN ===== */
.tg-main {
    background: #fafafa;
    min-height: 60vh;
}

.tg-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 24px 100px;
}

/* ===== FILTER ===== */
.tg-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.tg-tabs {
    display: flex;
    gap: 8px;
}

.tg-tab {
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #888;
    text-decoration: none;
    border-radius: 100px;
    transition: all 0.2s;
}

.tg-tab:hover {
    color: #333;
    background: #f0f0f0;
}

.tg-tab.active {
    color: #fff;
    background: #111;
}

.tg-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tg-count {
    font-size: 0.9rem;
    color: #888;
}

.tg-write-btn {
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #111;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.2s;
}

.tg-write-btn:hover {
    background: #111;
    color: #fff;
    border-color: #111;
}

/* ===== GRID ===== */
.tg-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.tg-item {
    display: block;
    text-decoration: none;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.tg-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* 정사각형 썸네일 */
.tg-thumb {
    position: relative;
    aspect-ratio: 1;
    background: #f5f5f5;
    overflow: hidden;
}

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

.tg-item:hover .tg-thumb img {
    transform: scale(1.05);
}

.tg-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ddd;
}

.tg-no-img svg {
    width: 48px;
    height: 48px;
}

/* 호버 오버레이 */
.tg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.tg-overlay svg {
    width: 32px;
    height: 32px;
    color: #fff;
}

.tg-item:hover .tg-overlay {
    opacity: 1;
}

/* 배지 */
.tg-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background: #111;
    border-radius: 2px;
    letter-spacing: 0.5px;
}

.tg-badge.new {
    background: #B76E79;
}

/* 정보 박스 */
.tg-info-box {
    padding: 16px;
}

.tg-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #111;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tg-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #999;
}

.tg-cat {
    color: #B76E79;
    font-weight: 500;
}

.tg-cat::after {
    content: '·';
    margin-left: 8px;
    color: #ddd;
}

/* ===== EMPTY ===== */
.tg-empty {
    text-align: center;
    padding: 100px 20px;
    color: #ccc;
}

.tg-empty svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.tg-empty p {
    font-size: 1rem;
    color: #999;
    margin: 0;
}

/* ===== PAGINATION ===== */
.tg-pagination {
    margin-top: 60px;
    text-align: center;
}

.tg-pagination .pg_wrap {
    display: inline-flex;
    gap: 4px;
}

.tg-pagination .pg_page,
.tg-pagination .pg_current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.tg-pagination .pg_page {
    color: #666;
}

.tg-pagination .pg_page:hover {
    background: #f0f0f0;
    color: #111;
}

.tg-pagination .pg_current {
    background: #111;
    color: #fff;
}

.tg-pagination .pg_start,
.tg-pagination .pg_prev,
.tg-pagination .pg_next,
.tg-pagination .pg_end {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s;
}

.tg-pagination .pg_start:hover,
.tg-pagination .pg_prev:hover,
.tg-pagination .pg_next:hover,
.tg-pagination .pg_end:hover {
    background: #f0f0f0;
    color: #111;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .tg-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .tg-hero {
        padding: 120px 20px 60px;
    }

    .tg-hero-title {
        font-size: 1.8rem;
    }

    .tg-hero-shapes,
    .tg-brush {
        display: none;
    }

    .tg-filter {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .tg-tabs {
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .tg-tab {
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .tg-info {
        justify-content: space-between;
    }

    .tg-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .tg-info-box {
        padding: 12px;
    }

    .tg-title {
        font-size: 0.85rem;
    }

    .tg-container {
        padding: 40px 16px 60px;
    }
}

@media (max-width: 480px) {
    .tg-grid {
        gap: 8px;
    }

    .tg-info-box {
        padding: 10px;
    }

    .tg-meta {
        font-size: 0.75rem;
    }
}

/* ===== VIEW PAGE ===== */
.tg-view-wrap {
    font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: #fafafa;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
}

.tg-view-hero.tg-hero {
    padding: 140px 24px 60px;
}

.tg-view-hero .tg-shape-1 {
    width: 80px;
    height: 80px;
    top: 30%;
    left: 15%;
}

.tg-view-hero .tg-shape-2 {
    width: 60px;
    height: 60px;
    top: 50%;
    right: 20%;
}

.tg-view-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 24px 100px;
}

.tg-view-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #888;
    text-decoration: none;
    margin-bottom: 32px;
    transition: color 0.2s;
}

.tg-view-back:hover {
    color: #111;
}

.tg-view-back svg {
    width: 18px;
    height: 18px;
}

.tg-view-article {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.tg-view-images {
    background: #f5f5f5;
    padding: 40px;
    text-align: center;
}

.tg-view-images img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 24px;
}

.tg-view-images img:last-child {
    margin-bottom: 0;
}

.tg-view-content {
    padding: 40px;
}

.tg-view-cat {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #B76E79;
    margin-bottom: 12px;
}

.tg-view-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: #111;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.tg-view-meta {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: #888;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 24px;
}

.tg-view-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tg-view-meta-item svg {
    width: 16px;
    height: 16px;
}

.tg-view-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
}

.tg-view-body img {
    max-width: 100%;
    height: auto;
    margin: 16px 0;
}

.tg-view-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 24px 40px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.tg-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
}

.tg-view-btn-primary {
    background: #111;
    color: #fff;
}

.tg-view-btn-primary:hover {
    background: #333;
}

.tg-view-btn-secondary {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.tg-view-btn-secondary:hover {
    background: #f5f5f5;
    color: #111;
}

.tg-view-btn-danger {
    color: #c00;
    border-color: #fcc;
}

.tg-view-btn-danger:hover {
    background: #fee;
}

.tg-view-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 40px;
}

.tg-view-nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.tg-view-nav-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.tg-view-nav-item.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.tg-view-nav-item.next {
    flex-direction: row-reverse;
    text-align: right;
}

.tg-view-nav-icon {
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    flex-shrink: 0;
}

.tg-view-nav-icon svg {
    width: 18px;
    height: 18px;
}

.tg-view-nav-label {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 4px;
}

.tg-view-nav-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tg-view-comments {
    margin-top: 40px;
    background: #fff;
    border-radius: 8px;
    padding: 32px;
}

@media (max-width: 768px) {
    .tg-view-hero {
        padding: 100px 20px 40px;
    }

    .tg-view-container {
        padding: 40px 16px 60px;
    }

    .tg-view-images {
        padding: 20px;
    }

    .tg-view-content {
        padding: 24px;
    }

    .tg-view-title {
        font-size: 1.2rem;
    }

    .tg-view-actions {
        flex-wrap: wrap;
        padding: 20px;
    }

    .tg-view-nav {
        grid-template-columns: 1fr;
    }

    .tg-view-comments {
        padding: 20px;
    }
}

/* ===== WRITE PAGE ===== */
.tg-write-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 60px 24px 100px;
}

.tg-write-form {
    background: #fff;
    border-radius: 8px;
    padding: 40px;
}

.tg-form-group {
    margin-bottom: 24px;
}

.tg-form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #111;
    margin-bottom: 8px;
}

.tg-form-group .required {
    color: #B76E79;
}

.tg-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tg-input,
.tg-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 0.95rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.tg-input:focus,
.tg-select:focus {
    outline: none;
    border-color: #111;
}

.tg-editor {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.tg-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.tg-file-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px dashed #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: #888;
}

.tg-file-label:hover {
    border-color: #111;
    background: #fafafa;
}

.tg-file-label svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.tg-file-label span {
    font-size: 0.9rem;
}

.tg-file-label input {
    display: none;
}

.tg-file-del {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #888;
    cursor: pointer;
}

.tg-options {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-top: 1px solid #f0f0f0;
}

.tg-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
}

.tg-option input {
    width: 18px;
    height: 18px;
    accent-color: #111;
}

.tg-form-actions {
    display: flex;
    gap: 12px;
    padding-top: 32px;
    border-top: 1px solid #f0f0f0;
}

.tg-btn {
    flex: 1;
    padding: 16px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.tg-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.tg-btn-cancel:hover {
    background: #eee;
}

.tg-btn-submit {
    background: #111;
    color: #fff;
}

.tg-btn-submit:hover {
    background: #333;
}

@media (max-width: 768px) {
    .tg-write-container {
        padding: 40px 16px 60px;
    }

    .tg-write-form {
        padding: 24px;
    }

    .tg-form-row {
        grid-template-columns: 1fr;
    }

    .tg-form-actions {
        flex-direction: column;
    }
}
