/* ===== 주식시장 위젯 (환율 위젯 아래, 광고칸 가로 전체) =====
   .ad-banner 기본값(글자 투명, 높이 72px)을 덮어써요. */
.ad-grid .stock-widget {
    grid-column: 2;          /* 오른쪽 열(구글·네이버·넷플릭스와 같은 열) */
    grid-row: 4;
    height: auto;
    display: flex;
    flex-direction: column;
    padding: 8px 8px 6px;
    overflow: hidden;
    background: linear-gradient(160deg, #3d5391 0%, #6b58a8 55%, #a2639f 100%);
    border: 1px solid #5a4aa8;
    color: #fff;
    font-size: 0.8rem;
    /* 2026-11-13: 오른쪽 칸 높이가 모자라도 납작해지지 않게, 최소한 내용 높이만큼은 확보 */
    min-height: max-content;
}

.stk-title {
    margin: 0 0 2px;
    font-size: 0.9rem;
    line-height: 1.2;
    text-align: center;
    color: #fff;
}

.stk-group {
    margin: 6px 0 2px;
    padding-bottom: 2px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.stk-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.stk-list li {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.stk-list li:first-child { border-top: 0; }

.stk-name {
    color: inherit;
    text-decoration: none;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.92);
}
.stk-name:hover { text-decoration: underline; color: #fff; }

.stk-price {
    flex: none;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    color: #ffd166;
    white-space: nowrap;
}

.stk-chg {
    flex: none;
    min-width: 52px;
    text-align: right;
    font-size: 0.66rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.7);
}
.stk-chg.up   { color: #ff8a8a; }   /* 상승: 빨강 */
.stk-chg.down { color: #7fc0ff; }   /* 하락: 파랑 */

.stk-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    margin-top: 6px;
    font-size: 0.55rem;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
}

/* ===== 넷플릭스 칸 (네이버 칸 아래) ===== */
.ad-grid .netflix-ad {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #141414;
    border: 1px solid #000;
    text-decoration: none;
}

.ad-grid .netflix-ad::after {
    content: "NETFLIX";
    color: #e50914;
    font-family: "Arial Black", Arial, sans-serif;
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

/* ===== 우편번호 검색 칸 (주식시장표 왼쪽, 환율 위젯 아래) ===== */
/* 왼쪽 열: 위 = 우편번호 칸(내용 높이만큼), 아래 = 남는 빈 칸 */
.ad-grid .pst-col {
    grid-column: 1;
    grid-row: 4;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.ad-grid .spare-widget {
    position: relative;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    background: #d62839;     /* 빨간 바탕 */
    border: 1px solid #a81d2b;
}

/* 안쪽 사각형: 바깥 칸과 같은 비율(가로·세로 75%), 굵은 흰 테두리, 안은 빨간색 */
.ad-grid .spare-widget::after {
    content: "";
    position: absolute;
    inset: 12.5%;
    border: 4px solid #fff;
    border-radius: 3px;
    background: #d62839;
}

.ad-grid .postal-widget {
    flex: none;
    height: auto;            /* 내용 높이만큼만 */
    display: flex;
    flex-direction: column;
    padding: 8px 8px 6px;
    overflow: hidden;
    background: linear-gradient(160deg, #2b4a63 0%, #32627a 100%);   /* 차분한 딥 틸블루 */
    border: 1px solid #274558;
    color: #fff;
    font-size: 0.8rem;
}

.pst-title {
    margin: 0 0 6px;
    font-size: 0.9rem;
    line-height: 1.2;
    text-align: center;
    color: #fff;
}

.pst-btn {
    width: 100%;
    padding: 7px 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #24364b;
    background: #f1dcae;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}
.pst-btn:hover { background: #f7e6c0; }

.pst-result {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    text-align: center;
    min-width: 0;
}

.pst-zip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
}
.pst-result.has .pst-zip { cursor: pointer; }

.pst-d {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border: 1px solid #fff;
    border-radius: 3px;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    color: #f1dcae;
}

.pst-addr {
    margin-top: 3px;
    font-size: 0.68rem;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.92);
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.pst-jibun { color: rgba(255, 255, 255, 0.7); }
.pst-addr:empty { display: none; }

.pst-actions {
    display: none;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
}
.pst-result.has .pst-actions { display: flex; }

.pst-copy,
.pst-reset {
    padding: 3px 10px;
    font-size: 0.68rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.pst-copy:hover,
.pst-reset:hover { background: rgba(255, 255, 255, 0.28); }

.pst-msg {
    padding-top: 4px;
    min-height: 1.2em;
    font-size: 0.6rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
}

/* 화면이 좁을 때(1100px 이하)는 반폭이 너무 좁아서 가로 전체로 */
@media screen and (max-width: 1100px) {
    .ad-grid .pst-col { grid-column: 1 / -1; grid-row: 4; }
    .ad-grid .spare-widget { min-height: 72px; }
    .ad-grid .stock-widget  { grid-column: 1 / -1; grid-row: 5; }
}

/* ===== 오른쪽 광고 영역을 행 높이만큼 늘려서, 주식시장표 하단이 왼쪽 그림·뉴스 줄 하단과 맞게 ===== */
.ad-sidebar .ad-grid {
    height: 100%;
    grid-template-rows: repeat(3, minmax(72px, auto)) 1fr;
}
@media screen and (max-width: 1100px) {
    .ad-sidebar .ad-grid { grid-template-rows: repeat(3, minmax(72px, auto)) auto 1fr; }
}

/* ===== 졸라맨 애니메이션 (빨간 박스 안 흰 사각형, spare.js) ===== */
.ad-grid .spare-widget .spare-scene {
    position: absolute;
    inset: 12.5%;            /* 흰 테두리 사각형과 같은 위치 */
    z-index: 1;              /* ::after(빨간 바탕)보다 위에 */
    padding: 4px;            /* 흰 테두리 두께만큼 안쪽으로 */
    box-sizing: border-box;
    pointer-events: none;
}
.spare-scene svg { display: block; width: 100%; height: 100%; }

/* 거래일 표시 (2026-11-15) — 제목 바로 아래 */
.stk-date {
    margin: 0 0 1px;
    text-align: center;
    font-size: 0.62rem;
    line-height: 1.3;
    color: #ffe8a3;
    letter-spacing: 0.01em;
}
.stk-date:empty { display: none; }
@media (max-width: 768px) {
    .stk-date { font-size: 0.78rem; margin-bottom: 2px; }
}
