/* static/css/style.css */

/* [공통] 배경 및 폰트 */
body { font-family: 'Noto Sans KR', sans-serif; background-color: #f7f2ee; color: #333; margin: 0;
       /* [수정] 가로 스크롤 방지를 여기로 옮김 (sticky 고정을 위해) */
    overflow-x: hidden;
}

.poiret-one-regular {
  font-family: "Poiret One", sans-serif;
  font-weight: 400;
  font-style: normal;
}

/* [추가] 전체 내용을 감싸는 990px 박스 */
.layout-wrapper {
    max-width: 990px;
    margin: 0 auto; /* 화면 중앙 정렬 */
    background-color: #fbf9f7; /* 기존 콘텐츠 배경색 */
    min-height: 100vh; /* 내용이 적어도 화면 높이 꽉 채우기 */
    position: relative;

    padding-top: 60px; /* 모바일 기준 */
}

/* [공통] 상단 네비게이션 바 */
.navbar {
    background-color: #fff;

    height: 60px;

    /* [수정] fixed로 변경하여 화면에 항상 떠 있게 함 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1050;

    /* [추가] 부드러운 움직임 (transition) */
    transition: transform 0.3s ease-in-out;
}

/* [숨김 클래스] 스크롤 내릴 때 붙는 클래스 */
.navbar-hidden {
    transform: translateY(-100%); /* 위로 숨김 */
}

.navbar-brand { font-weight: 800; position: absolute; left: 50%; transform: translateX(-50%); text-decoration: none; font-size: 1.3rem; }
.logo-dentpharm { color: #1d3557; }
.logo-mind { color: #457b9d; }

/* [공통] 홈 버튼 (우측 상단 아이콘) */
.home-button-wrapper { position: absolute; right: 20px; }
.home-btn { width: 28px; height: 28px; transition: all 0.2s; opacity: 0.7; }
.home-btn:hover { transform: translateY(-2px); opacity: 1; }


/* [추가] 소셜 미디어 아이콘 스타일 */

/* 1. 데스크탑용 소셜 아이콘 위치 및 모양 */
.social-icons-desktop {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    gap: 12px; /* 아이콘 사이 간격 */
    align-items: center;
}

.social-icons-desktop img {
    width: 24px;  /* 데스크탑에서 보여질 크기 */
    height: 24px;
    opacity: 0.6; /* 평소엔 약간 흐리게 */
    transition: all 0.2s ease;
    display: block; /* 이미지 하단 여백 제거 */
}

.social-icons-desktop img:hover {
    opacity: 1;   /* 마우스 올리면 선명하게 */
    transform: translateY(-2px); /* 살짝 위로 뜸 */
}



.social-link-mobile img {
    width: 24px; /* 모바일은 손가락 터치 고려해 살짝 크게 */
    height: 24px;
    opacity: 0.9; /* 모바일은 hover가 없으니 처음부터 잘 보이게 */
    filter: brightness(0) invert(1);
    transition: transform 0.2s;
}

.social-link-mobile:active img {
    transform: scale(0.9); /* 터치 시 눌리는 효과 */
    opacity: 0.7;
}




/* [메뉴] 데스크탑 (가로 바) */
.desktop-menu {
    display: none;
    justify-content: center;
    gap: 5px;
    padding: 4px 0;
    background-color: #b3a59d;


    /* [수정] fixed로 변경 */
    position: fixed;
    top: 60px; /* navbar 바로 아래 */
    left: 0;
    width: 100%;
    z-index: 1040;

    /* [추가] 부드러운 움직임 */
    transition: transform 0.3s ease-in-out;
}

/* [데스크탑 메뉴 숨김 클래스] */
.desktop-menu-hidden {
    transform: translateY(-100px); /* 위로 숨김 (충분히 올려줌) */
}

/* 데스크탑 메뉴 기본 링크 스타일 */
.desktop-menu .menu-link,
.desktop-menu .dropdown-toggle {
    text-decoration: none;
    color: #f7f2ee;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 25px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: none;
    border: none;
    display: inline-block;
}

.desktop-menu .menu-link:hover,
.desktop-menu .dropdown-toggle:hover,
.desktop-menu .dropdown-toggle.show {
    background-color: #1d3557;
    color: #ffffff !important;
}

/* 데스크탑 드롭다운 메뉴 박스 */
.desktop-menu .dropdown-menu {
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 10px 0;
    margin-top: 10px !important; /* 메뉴바와 간격 */
}

.desktop-menu .dropdown-item {
    font-size: 0.9rem;
    padding: 8px 20px;
    color: #333;
    font-weight: 500;
}
.desktop-menu .dropdown-item:hover {
    background-color: #f0f4f8;
    color: #1d3557;
}


.essay-btn {
    background-color: #1d3557;
    border: none;
    transition: all 0.3s ease;
}

.essay-btn:hover {
    background-color: #2a4a6f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.essay-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


/* [메뉴] 모바일 사이드바 */
.menu-trigger { position: absolute; left: 15px; background: none; border: none; font-size: 1.5rem; color: #1d3557; padding: 4px; border-radius: 8px; transition: background-color 0.3s ease; }
.menu-trigger:hover { background-color: rgba(29, 53, 87, 0.1); }

.offcanvas {  background-color: rgba(29, 53, 87, 0.98) !important; backdrop-filter: blur(10px); color: white; border: none;  overflow: visible !important; }
.offcanvas .offcanvas-title { font-style: normal; }

.nav-link-custom {
    color: rgba(229,238,241,0.85);
    padding: 12px 24px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1rem;
    font-style: normal;
    transition: all 0.3s ease;
}

.nav-link-custom:hover, .nav-link-custom:focus {
    color: #fff;
    background-color: rgba(255,255,255,0.05);
}

/* 모바일 하위 메뉴 (뉴스 요약 내부) */
.sub-menu-container {
    background-color: rgba(0, 0, 0, 0.2);
}
.nav-link-sub {
    color: rgba(255,255,255,0.7);
    padding: 10px 24px 10px 38px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    font-style: normal;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}
.nav-link-sub:hover {
    color: #fff;
    padding-left: 45px;
    background-color: rgba(255,255,255,0.05);
}

/* 화살표 아이콘 회전 애니메이션 */
.dropdown-toggle::after {
    transition: transform 0.2s;
}
.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* 모바일 전용 갭 박스 */
.mobile-gap-box {
  background-color: #b3a59d;
  padding: 8px 0;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
}

.btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }

/* ========================================
   [페이지별] Index 홈페이지 (수정됨)
======================================== */
.home-banner {
    padding-top: 20px;
    padding-bottom: 40px;
    background-color: #fbf9f7;
}

/* 컨테이너 좁히기 (데스크탑에서만 적용) */
.home-narrow {
    max-width: 800px; /* 전체 너비 제한 992px */
}

/* 이미지 반응형 처리 */
.home-img {
    width: 100%;
    max-width: 400px; /* 최대 400px */
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    display: block;
    margin: 0 auto; /* 중앙 정렬 */
}

/* 텍스트 영역 */
.home-title {
    font-size: 2rem; /* 기본 크기 */
    line-height: 1.3;
}

.home-desc {
    font-size: 1.2rem;
    line-height: 1.7;
    color: #ffffff;
    font-weight: 600;

}

.title-underline {
    width: 60px;
    height: 4px;
    background-color: #457b9d;
    margin-bottom: 20px;
}

/* 데스크톱/태블릿(768px 이상): 상단 데스크 메뉴 사용 */
@media (min-width: 768px) {
  .menu-trigger { display: none; }
  .desktop-menu { display: flex; }
  .layout-wrapper {
        padding-top: 100px; /* 데스크탑 기준 (상단바 + 메뉴바 높이) */
    }
}

/* 모바일(768px 미만): offcanvas 폭 */
@media (max-width: 767.98px) {
  .offcanvas.offcanvas-start {
    width: min(70vw, 380px) !important;
  }


}


/* 데스크탑 (lg 이상: 992px 이상) */
@media (min-width: 992px) {
    /* 이미지 컬럼 고정 너비 */
    .home-banner .col-lg-5 {
        flex: 0 0 400px; /* 정확히 400px 고정 */
        max-width: 400px;
    }

    .home-img {
        width: 400px; /* 정확히 400px */
        max-width: 400px;
    }

    /* 텍스트 영역은 나머지 공간 사용 */
    .home-banner .col-lg-7 {
        flex: 1; /* 남은 공간 차지 */
        max-width: none;
    }

    .home-title {
        font-size: 1.8rem;
    }

    .home-desc {
        font-size: 0.95rem;
        text-align: left;
        margin-left: 0;
        max-width: 100%;
    }

    /* 텍스트 영역 좌측 정렬 */
    .col-lg-7.text-center.text-lg-start {
        text-align: left !important;
    }

    /* 구분선도 좌측 정렬 */
    .col-lg-7.text-center.text-lg-start > div[style*="width: 60px"] {
        margin-left: 0 !important;
        margin-right: auto !important;
    }
}

/* 모바일 (991px 이하) */
@media (max-width: 991.98px) {
    .home-img {
        width: 95%; /* 화면의 95% */
        max-width: 400px; /* 최대 400px 유지 */
    }

    .home-title {
        font-size: 1.8rem; /* 모바일에서 적당히 */
        width: 95%; /* 이미지와 동일한 너비 */
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
        text-align: left;
    }

    .home-desc {
        font-size: 0.95rem;
        text-align: left;
        width: 95%; /* 이미지와 동일한 너비 */
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    /* 모바일에서 전체 중앙 정렬 */
    .col-lg-7 {
        text-align: center !important;
        display: flex;
        flex-direction: column;
        align-items: center; /* 자식 요소들 중앙 정렬 */
    }

    /* 구분선도 중앙 정렬 */
    .col-lg-7 > div[style*="width: 60px"] {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* 버튼 영역도 이미지 너비에 맞춤 */
    .col-lg-7 .mt-4 {
        text-align: center !important;
        width: 95%;
        max-width: 400px;
    }
}

/* 태블릿 (768px ~ 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .home-title {
        font-size: 2rem;
    }

    .home-desc {
        font-size: 1rem;
    }
}

/* ========================================
   [페이지별] PharmPaper 뉴스 카드
======================================== */
.card-custom { background: white; border: none; border-radius: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); transition: 0.3s; height: 100% ; display: flex; flex-direction: column; }
.card-custom:hover { transform: none; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.card-custom:hover .news-img-wrapper img { transform: scale(1.1); }

.badge-domestic { background-color: #e63946; color: white; padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 500; }
.badge-global { background-color: #457b9d; color: white; padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 500; }

.news-title { color: #1d3557; font-weight: 700; font-size: 1.15rem; line-height: 1.4; margin-bottom: 15px; min-height: 52px; }
.news-summary { color: #555; font-size: 0.95rem; line-height: 1.6; flex-grow: 0; margin-bottom: 10px; text-align: justify;}
.news-source { font-size: 0.85rem; color: #888; border-top: 1px solid #f0f0f0; padding-top: 15px; display: block; margin-top: auto;}

/* [추가] 뉴스 카드 하단 Source 링크 버튼 효과 */
.source-link-btn {
    display: inline-block;
    font-size: 0.85rem;
    color: #888;
    text-decoration: none;
    padding: 8px 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-top: auto;
    transition: all 0.3s ease;
    background-color: #fcfcfc;
}

.source-link-btn:hover {
    background-color: #5f7ea3;
    color: #ffffff;
    border-color: #5f7ea3;
    box-shadow: 0 4px 8px rgba(29, 53, 87, 0.2);
    transform: translateY(-2px);
}

.source-url-link {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    overflow: hidden;
}

.source-url-label {
    flex: 0 0 auto;
}

.source-url-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-url-icon {
    flex: 0 0 auto;
}

/* [추가] 사이드바 바깥으로 튀어나온 접기 버튼 스타일 */
.sidebar-close-tab {
    position: absolute;
    top: 50%;
    right: -30px;
    width: 30px;
    height: 60px;
    transform: translateY(-50%);
    background-color: rgba(29, 53, 87, 0.98);
    border: none;
    border-radius: 0 10px 10px 0;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 5px 0 10px rgba(0,0,0,0.1);
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.sidebar-close-tab:hover {
    background-color: #457b9d;
}

/* [추가] 로그인/로그아웃 버튼 호버 효과 */
.auth-hover {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.auth-hover:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* [추가] 상단바 로그인/로그아웃 위치 및 스타일 */
.auth-wrapper {
    position: absolute;
    right: 100px; /* 홈버튼(15px) + 버튼크기(28px) + 간격(약17px) */
    top: 50%;
    transform: translateY(-50%);
    align-items: center;
    gap: 8px;
}

.auth-username {
    color: #647893; /* 요청하신 색상 */
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap; /* 줄바꿈 방지 */
}

.auth-wrapper .auth-hover {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.auth-wrapper .auth-hover:hover {
    transform: scale(1.05);
    opacity: 0.9;
}



/* ... 기존 내용 끝 ... */

/* =========================================
   [Index] Latest News Slider (최신 뉴스 슬라이더)
   ========================================= */

/* 슬라이더 섹션 배경 및 레이아웃 */
.latest-news-slider {
    margin-top: 50px;
    background-color: #706b69;
    padding: 30px 0;
    width: 100%;
}

/* 슬라이더 내부 컨테이너 최대 폭 제한 */
.latest-news-slider .container {
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* 모바일에서는 패딩 줄이기 */
@media (max-width: 768px) {
    .latest-news-slider .container {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* 슬라이더 컨테이너: 가로 스크롤, 스크롤바 숨김 */
.slider-container {
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 5px; /* 그림자 잘림 방지 여백 */
    -ms-overflow-style: none;  /* IE, Edge */
    scrollbar-width: none;  /* Firefox */
    width: 100%;

}
.slider-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

/* 카드 링크 스타일 (고정 사이즈) */
.news-card-link {
    flex: 0 0 auto; /* 크기 고정 */
    width: 220px;   /* 카드 너비 */
    height: 200px;  /* 카드 높이 */
    transition: transform 0.2s;
    text-decoration: none; /* 링크 밑줄 제거 */
}

.news-card-link:hover {
    transform: translateY(-5px);
}

/* 카드 내부 디자인 */
.news-mini-card {
    border-radius: 12px;
    border: none;
    overflow: hidden;
    background-color: #fff;
    height: 100%; /* 부모 높이 채움 */
}

/* 이미지 영역 */
.card-img-wrapper {
    height: 110px; /* 이미지 높이 고정 */
    width: 100%;
    position: relative;
    overflow: hidden;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.7rem;
    opacity: 0.8;
}

/* 텍스트 3줄 말줄임 (...) */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 3줄까지 표시 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: normal;
    color: #333;
}

/* 좌우 이동 버튼 스타일 */
.slider-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* 버튼 크기 안 줄어들게 */
}

.slider-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
}

.prev-btn { margin-right: 15px; }
.next-btn { margin-left: 15px; }

/* 모바일 반응형 */
@media (max-width: 768px) {
    .news-card-link {
        width: 180px;
        height: 190px;
    }
    .slider-btn {
        display: none; /* 모바일에선 터치 스크롤이 편하므로 버튼 숨김 */
    }
    .slider-container {
        padding-right: 20px; /* 오른쪽 여백 확보 */
    }
}

/* =========================================
   [Index] Research Highlights
   ========================================= */
.research-highlight-section {
    width: 100%;
    background: #f7f2ee;
    padding: 28px 0 40px;
}

.research-highlight-section .container {
    max-width: 850px;
}

.research-highlight-top-divider {
    height: 3px;
    margin: 0 12px 16px;
    background: #4e4a48;
}

.research-highlight-list {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 10px;
}

.research-highlight-row {
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.25);
    padding-bottom: 10px;
}

.research-highlight-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #2f2c2a;
    padding: 8px 8px;
}

.research-highlight-link.is-disabled {
    cursor: default;
}

.research-highlight-link:hover {
    color: #1d3557;
}

.research-highlight-thumb {
    width: 78px;
    height: 78px;
    object-fit: cover;
    border-radius: 8px;
    flex: 0 0 78px;
}

.research-highlight-text-wrap {
    min-width: 0;
    width: 100%;
}

.research-highlight-channel {
    font-size: 0.82rem;
    font-weight: 700;
    color: #6a6866;
    margin-bottom: 4px;
}

.research-highlight-title {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.4;
    color: #2f2c2a;
    word-break: keep-all;
}

@media (max-width: 768px) {
    .research-highlight-list {
        grid-template-columns: 1fr;
        row-gap: 8px;
    }

    .research-highlight-link {
        gap: 12px;
        padding: 7px 4px;
    }

    .research-highlight-thumb {
        width: 68px;
        height: 68px;
        flex-basis: 68px;
    }

    .research-highlight-title {
        font-size: 0.96rem;
    }

    .research-highlight-top-divider {
        margin: 0 8px 14px;
    }
}





