/*
Theme Name: 남강TV (NKTV)
Theme URI: https://www.namkangtv.com/
Author: NKTV
Description: 남강고등학교 총동문회 포털 테마 — 총동문회 소식, 유튜브 영상, 지회 동문회 배너, 후원인 페이지로 구성된 맞춤 테마.
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: namkangtv
*/

/* ============ 디자인 토큰 ============ */
:root{
  /* 남강고 브랜드 색 — 파랑 #3080C0 / 초록(라임) #A0C000 + 차콜 (로고 배너 기준)
     변수명은 호환을 위해 유지(navy=차콜, gold=초록, crimson=파랑 강조) */
  --navy:   #1f2630;   /* 차콜 — 헤더/푸터/다크 영역 (로고 배너 배경) */
  --navy2:  #2f80c0;   /* 브랜드 파랑 — 링크/소제목/포인트 */
  --blue:   #3080c0;   /* 브랜드 파랑 */
  --blue-d: #246aa3;
  --green:  #a0c000;   /* 브랜드 초록(라임) */
  --gold:   #a0c000;   /* (구 골드 자리 = 초록 포인트) */
  --gold2:  #b9d63a;   /* 밝은 초록 */
  --crimson:#2f80c0;   /* 강조 라벨/기수 = 파랑 */
  --ink:    #1c2430;   /* 본문 글자 */
  --muted:  #5b6670;
  --line:   #e4e7ec;
  --paper:  #f5f7fa;
  --card:   #ffffff;
  --radius: 14px;
  --maxw:   1200px;
  --shadow: 0 6px 24px rgba(13,42,74,.08);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0; background:var(--paper); color:var(--ink);
  font-family:"Pretendard","Noto Sans KR","맑은 고딕","Malgun Gothic",system-ui,sans-serif;
  line-height:1.65; -webkit-font-smoothing:antialiased;
}
a{color:inherit; text-decoration:none}
img{max-width:100%; height:auto; display:block}
.container{max-width:var(--maxw); margin:0 auto; padding:0 20px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* ============ 헤더 ============ */
.site-header{background:var(--navy); color:#fff; position:sticky; top:0; z-index:100;
  box-shadow:0 2px 14px rgba(0,0,0,.18);
  border-top:4px solid var(--green);        /* 로고 배너 초록 라인 */
  border-bottom:3px solid var(--blue)}        /* 로고 배너 파랑 라인 */
.site-header .container{display:flex; align-items:center; gap:18px; min-height:74px}
.site-brand{display:flex; align-items:center; gap:12px; font-weight:800; font-size:1.35rem; letter-spacing:-.5px}
/* 커스텀 로고(WP) — 헤더 높이에 맞춰 크기 제한 */
.site-brand .custom-logo-link{display:flex;align-items:center;line-height:0}
.site-brand .custom-logo{height:52px;width:auto;max-width:230px;display:block}
.brand-fallback{display:flex;align-items:center;gap:12px;color:#fff}
.site-brand .logo-badge{width:42px;height:42px;border-radius:10px;display:grid;place-items:center;
  background:linear-gradient(135deg,var(--gold),var(--gold2)); color:var(--navy); font-weight:900}
.site-brand small{display:block;font-size:.66rem;font-weight:600;color:var(--gold2);letter-spacing:2px}
.primary-nav{margin-left:auto}
.primary-nav ul{display:flex; gap:4px; list-style:none; margin:0; padding:0; flex-wrap:wrap}
.primary-nav a{display:block; padding:10px 14px; border-radius:9px; font-weight:600; font-size:.96rem; color:#dfe7f1}
.primary-nav a:hover{background:rgba(255,255,255,.10); color:#fff}
.primary-nav .current-menu-item>a{color:var(--gold2)}
.nav-toggle{display:none;margin-left:auto;background:none;border:0;color:#fff;font-size:1.6rem;cursor:pointer}

/* ============ 섹션 공통 ============ */
.section{padding:54px 0}
.section-head{display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:26px; gap:16px}
.section-title{font-size:1.65rem; font-weight:800; letter-spacing:-.6px; margin:0;
  display:flex; align-items:center; gap:12px}
.section-title::before{content:""; width:6px; height:26px; border-radius:4px;
  background:linear-gradient(var(--gold),var(--gold2))}
.section-title small{display:block;font-size:.74rem;color:var(--navy2);font-weight:700;letter-spacing:2px;margin-bottom:2px}
.section-more{color:var(--navy2); font-weight:700; font-size:.92rem}
.section-more:hover{color:var(--gold)}
.section.alt{background:#fff}

/* ============ 히어로 5개 롤링 슬라이더 ============ */
.hero-slider{position:relative;border-radius:var(--radius);overflow:hidden;
  height:480px;background:var(--navy);box-shadow:var(--shadow)}
.hero-slider .slides{display:flex;height:100%;transition:transform .6s cubic-bezier(.4,0,.2,1)}
.slide{position:relative;min-width:100%;height:100%}
.slide img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.slide .ov{position:absolute;inset:0;background:linear-gradient(transparent 35%,rgba(15,22,30,.92))}
.slide .meta{position:absolute;left:0;right:0;bottom:0;padding:34px 40px;color:#fff;display:block}
.badge{display:inline-block;background:var(--crimson);color:#fff;font-weight:700;font-size:.74rem;
  padding:5px 11px;border-radius:999px;letter-spacing:.5px}
.slide h2{font-size:2rem;line-height:1.3;margin:12px 0 6px;font-weight:800;max-width:80%}
.slide .by{color:#cfe0ef;font-size:.9rem}
/* 좌우 화살표 */
.hero-nav{position:absolute;top:50%;transform:translateY(-50%);z-index:5;
  width:46px;height:46px;border:0;border-radius:50%;cursor:pointer;
  background:rgba(255,255,255,.22);color:#fff;font-size:1.7rem;line-height:1;
  display:grid;place-items:center;transition:background .15s}
.hero-nav:hover{background:var(--blue)}
.hero-nav.prev{left:16px}
.hero-nav.next{right:16px}
/* 하단 점 */
.hero-dots{position:absolute;left:0;right:0;bottom:14px;z-index:5;display:flex;justify-content:center;gap:8px}
.hero-dot{width:10px;height:10px;border-radius:50%;border:0;cursor:pointer;padding:0;
  background:rgba(255,255,255,.45);transition:all .2s}
.hero-dot.on{background:var(--green);width:26px;border-radius:6px}
@media (max-width:640px){
  .hero-slider{height:360px}
  .slide h2{font-size:1.4rem;max-width:100%}
  .slide .meta{padding:22px}
}

/* ============ 이벤트 배너 4개 (슬라이더 바로 아래, 최근기사와 다른 모양) ============ */
.ebanner-section{padding:24px 0 6px}
.ebanner-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.ebanner{position:relative;display:block;aspect-ratio:16/7;border-radius:12px;overflow:hidden;
  background:var(--navy);box-shadow:var(--shadow);border:2px solid transparent;
  transition:transform .15s,border-color .15s}
/* 이미지 미등록 배너 — 브랜드 그라데이션 배경(배너별 색 다르게) */
.ebanner:nth-child(4n+1){background:linear-gradient(135deg,#1d4e7e,#0d2a4a)}
.ebanner:nth-child(4n+2){background:linear-gradient(135deg,#3080c0,#1c4f86)}
.ebanner:nth-child(4n+3){background:linear-gradient(135deg,#3c9a78,#1f6f4a)}
.ebanner:nth-child(4n+4){background:linear-gradient(135deg,#8aa81f,#566f10)}
.ebanner:hover{transform:translateY(-3px);border-color:var(--green)}
.ebanner img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.ebanner .ov{position:absolute;inset:0;
  background:linear-gradient(90deg,rgba(11,26,44,.82),rgba(11,26,44,.15) 72%)}
.ebanner .tag{position:absolute;top:10px;left:10px;z-index:2;background:var(--green);
  color:#16240a;font-weight:800;font-size:.66rem;padding:3px 9px;border-radius:999px;letter-spacing:.6px}
.ebanner .label{position:absolute;left:14px;right:14px;bottom:12px;z-index:2;color:#fff;
  font-weight:800;font-size:1.04rem;line-height:1.32;text-shadow:0 1px 6px rgba(0,0,0,.5);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ebanner.placeholder{display:grid;place-items:center;color:var(--gold2);font-weight:800;
  border:2px dashed rgba(160,192,0,.55);aspect-ratio:16/7}

/* ============ 최근 기사 — 썸네일 위 카드 그리드(4열) ============ */
.recent-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}
.recent-card{display:flex;flex-direction:column;background:var(--card);
  border:1px solid var(--line);border-radius:12px;overflow:hidden;box-shadow:var(--shadow);
  transition:transform .15s,box-shadow .15s}
.recent-card:hover{transform:translateY(-3px);box-shadow:0 10px 26px rgba(13,42,74,.12)}
.recent-card .th{aspect-ratio:16/10;background:var(--paper);overflow:hidden}
.recent-card .th img{width:100%;height:100%;object-fit:cover}
.recent-card .body{padding:13px 15px 15px}
.recent-card h3{font-size:1rem;line-height:1.42;margin:0 0 7px;font-weight:700;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.recent-card .by{font-size:.8rem;color:var(--navy2)}

/* 사이드바 등에서 쓰는 가로형 항목 */
.side-item{display:grid;grid-template-columns:96px 1fr;gap:13px;background:var(--card);
  border:1px solid var(--line);border-radius:12px;padding:10px;box-shadow:var(--shadow)}
.side-item .th{width:96px;height:72px;border-radius:8px;overflow:hidden;background:var(--paper)}
.side-item .th img{width:100%;height:100%;object-fit:cover}
.side-item h3{font-size:1.02rem;margin:2px 0 4px;font-weight:700;line-height:1.35}
.side-item .by{font-size:.78rem;color:var(--navy2)}

/* ============ 유튜브 ============ */
/* 채널 배너 */
.yt-channel{display:flex;align-items:center;gap:16px;background:linear-gradient(100deg,#1f2630,#0f1620);
  border:1px solid #2a323d;border-left:5px solid #ff0033;border-radius:12px;padding:14px 18px;margin-bottom:20px;
  box-shadow:var(--shadow);transition:transform .15s}
.yt-channel:hover{transform:translateY(-2px)}
.yt-channel .yt-logo{width:44px;height:44px;border-radius:10px;background:#ff0033;position:relative;flex:none}
.yt-channel .yt-logo::after{content:"";position:absolute;top:50%;left:54%;transform:translate(-50%,-50%);
  border-style:solid;border-width:9px 0 9px 15px;border-color:transparent transparent transparent #fff}
.yt-channel .yt-meta{display:flex;flex-direction:column;line-height:1.3}
.yt-channel .yt-meta strong{color:#fff;font-size:1.15rem;font-weight:800}
.yt-channel .yt-meta small{color:#9fb0c4;font-size:.82rem}
.yt-channel .yt-sub{margin-left:auto;background:#ff0033;color:#fff;font-weight:800;font-size:.86rem;
  padding:9px 16px;border-radius:999px;white-space:nowrap}
.yt-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}
.yt-card{background:var(--card);border:1px solid var(--line);border-radius:12px;overflow:hidden;box-shadow:var(--shadow);cursor:pointer;transition:transform .15s}
.yt-card:hover{transform:translateY(-3px)}
.yt-thumb{position:relative;aspect-ratio:16/9;background:#000}
.yt-thumb img{width:100%;height:100%;object-fit:cover}
.yt-thumb .play{position:absolute;inset:0;display:grid;place-items:center}
.yt-thumb .play span{width:54px;height:54px;border-radius:50%;background:rgba(220,30,40,.92);
  display:grid;place-items:center}
.yt-thumb .play span::after{content:"";border-style:solid;border-width:10px 0 10px 17px;border-color:transparent transparent transparent #fff;margin-left:4px}
/* 숏츠(세로) 영역 — 따로 모음 */
.yt-shorts-head{display:flex;align-items:center;gap:9px;margin:26px 0 14px;font-weight:800;font-size:1.12rem;color:var(--ink)}
.yt-shorts-badge{background:#ff0033;color:#fff;font-size:.7rem;font-weight:800;padding:3px 9px;border-radius:6px;letter-spacing:.4px}
.yt-shorts{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:14px}
.yt-shorts .yt-thumb{aspect-ratio:9/16}          /* 세로폼 */
.yt-shorts .yt-card h3{font-size:.88rem;padding:9px 10px}
.yt-card h3{font-size:.98rem;font-weight:700;margin:0;padding:12px 14px;line-height:1.4}
.yt-embed{position:relative;aspect-ratio:16/9}
.yt-embed iframe{position:absolute;inset:0;width:100%;height:100%;border:0}

/* ============ 지회 배너 ============ */
.branch-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.branch-card{display:block;border-radius:12px;overflow:hidden;position:relative;background:var(--navy);
  box-shadow:var(--shadow);aspect-ratio:16/9;transition:transform .15s}
.branch-card:hover{transform:translateY(-3px)}
.branch-card img{width:100%;height:100%;object-fit:cover;opacity:.85}
.branch-card .label{position:absolute;inset:0;display:flex;align-items:flex-end;
  padding:14px;background:linear-gradient(transparent,rgba(7,22,40,.85));color:#fff;font-weight:800;font-size:1.05rem}
.branch-card.placeholder{display:grid;place-items:center;color:var(--gold2);font-weight:800;border:2px dashed rgba(255,255,255,.25)}

/* ============ 후원인 ============ */
.sponsor-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:18px}
.sponsor-card{background:var(--card);border:1px solid var(--line);border-radius:14px;
  padding:20px 14px;text-align:center;box-shadow:var(--shadow);transition:transform .15s}
.sponsor-card:hover{transform:translateY(-3px)}
.sponsor-card .photo{width:104px;height:104px;border-radius:50%;margin:0 auto 12px;overflow:hidden;
  background:var(--paper);border:3px solid var(--gold2)}
.sponsor-card .photo img{width:100%;height:100%;object-fit:cover}
.sponsor-card h3{margin:0;font-size:1.08rem;font-weight:800}
.sponsor-card .gen{color:var(--crimson);font-weight:700;font-size:.82rem;margin-top:2px}
.sponsor-card .title{color:var(--navy2);font-size:.86rem;margin-top:4px}

/* 후원인 — 홈 텍스트 리스트 (성명·직책만, 사진은 전체 페이지에서) */
.sponsor-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 34px}
.sponsor-list a{display:flex;align-items:baseline;justify-content:space-between;gap:12px;
  padding:13px 6px;border-bottom:1px dashed var(--line)}
.sponsor-list a:hover{background:#fff;border-radius:8px}
.sponsor-list .nm{font-weight:800;white-space:nowrap}
.sponsor-list .nm .gen{color:var(--crimson);font-size:.76rem;font-weight:700;margin-left:6px}
.sponsor-list .ti{color:var(--navy2);font-size:.9rem;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sponsor-more-wrap{text-align:center;margin-top:26px}
.sponsor-more{display:inline-block;background:var(--navy);color:#fff;font-weight:700;
  padding:12px 26px;border-radius:999px;transition:background .15s}
.sponsor-more:hover{background:var(--navy2);color:var(--gold2)}

/* ============ 글/아카이브 ============ */
.layout{display:grid;grid-template-columns:1fr 320px;gap:34px;padding:40px 0}
.post-list{display:grid;gap:18px}
.post-row{display:grid;grid-template-columns:200px 1fr;gap:18px;background:var(--card);
  border:1px solid var(--line);border-radius:12px;overflow:hidden;box-shadow:var(--shadow)}
.post-row .th{aspect-ratio:4/3;background:var(--paper)}
.post-row .th img{width:100%;height:100%;object-fit:cover}
.post-row .body{padding:16px 18px}
.post-row h2{font-size:1.18rem;margin:0 0 8px;font-weight:800;line-height:1.4}
.post-row .by{font-size:.82rem;color:var(--navy2)}
.post-row .ex{margin-top:8px;color:#46505e;font-size:.94rem}
.single{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:34px;box-shadow:var(--shadow)}
.single h1{font-size:1.9rem;line-height:1.3;margin:0 0 14px}
.single .byline{display:flex;gap:12px;align-items:center;color:var(--navy2);font-size:.9rem;
  border-bottom:1px solid var(--line);padding-bottom:16px;margin-bottom:22px}
.single .content{font-size:1.05rem}
.single .content img{border-radius:10px;margin:16px 0}
.widget{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:18px;margin-bottom:18px;box-shadow:var(--shadow)}
.widget h3{margin:0 0 12px;font-size:1.05rem}

/* ============ 전체 기사 목록 (한 줄에 하나, 작은 썸네일) ============ */
.article-list{display:flex;flex-direction:column;margin:6px 0 24px}
.list-row{display:grid;grid-template-columns:128px 1fr;gap:18px;padding:16px 6px;
  border-bottom:1px solid var(--line);align-items:start}
.list-row:hover{background:#fff;border-radius:8px}
.list-row .th{width:128px;height:84px;border-radius:8px;overflow:hidden;background:var(--paper)}
.list-row .th img{width:100%;height:100%;object-fit:cover}
.list-row .body{display:flex;flex-direction:column;gap:5px;min-width:0}
.list-row h2{font-size:1.12rem;margin:0;font-weight:700;line-height:1.4}
.list-row .by{font-size:.82rem;color:var(--navy2)}
.list-row .ex{font-size:.92rem;color:#56606e;line-height:1.55;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.nktv-pager{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;align-items:center;margin:8px 0 44px}
.nktv-pager a{padding:8px 13px;border:1px solid var(--line);border-radius:8px;
  color:var(--navy2);font-weight:600;background:#fff}
.nktv-pager a:hover{border-color:var(--blue);color:var(--blue)}
.nktv-pager a.on{background:var(--blue);color:#fff;border-color:var(--blue)}
.nktv-pager .dots{color:#9aa3ae;padding:0 2px}
@media (max-width:640px){
  .list-row{grid-template-columns:92px 1fr;gap:12px;padding:13px 4px}
  .list-row .th{width:92px;height:62px}
  .list-row h2{font-size:1rem}
  .list-row .ex{display:none}
}

/* ============ 기자(작성자) 아카이브 ============ */
.byline-author{font-weight:700;color:var(--navy2)}
.byline-author:hover{color:var(--green);text-decoration:underline}
.author-head{display:flex;gap:20px;align-items:center;background:var(--card);
  border:1px solid var(--line);border-radius:14px;padding:24px;margin:34px 0 6px;box-shadow:var(--shadow)}
.author-avatar img{width:96px;height:96px;border-radius:50%;border:3px solid var(--green)}
.author-head h1{margin:0;font-size:1.5rem}
.author-role{font-size:.86rem;color:#fff;background:var(--blue);padding:3px 10px;border-radius:999px;vertical-align:middle;margin-left:6px}
.author-bio{margin:8px 0 4px;color:#46505e}
.author-count{margin:6px 0 0;color:var(--navy2);font-weight:600;font-size:.92rem}

/* ============ 푸터 ============ */
.site-footer{background:var(--navy);color:#cdd8e6;margin-top:50px}
.site-footer .container{padding:40px 20px;display:grid;grid-template-columns:2fr 1fr 1fr;gap:30px}
.site-footer h4{color:#fff;margin:0 0 12px;font-size:1.05rem}
.site-footer a:hover{color:var(--gold2)}
.site-footer .copy{border-top:1px solid rgba(255,255,255,.12);text-align:center;padding:16px;font-size:.84rem;color:#9fb0c4}

/* ============ 반응형 ============ */
/* 태블릿 (≤980) */
@media (max-width:980px){
  .yt-grid,.branch-grid{grid-template-columns:repeat(2,1fr)}
  .yt-shorts{grid-template-columns:repeat(4,1fr)}
  .sponsor-grid{grid-template-columns:repeat(3,1fr)}
  .sponsor-list{grid-template-columns:repeat(2,1fr)}
  .recent-grid{grid-template-columns:repeat(2,1fr)}
  .ebanner-grid{grid-template-columns:repeat(2,1fr)}
  .layout{grid-template-columns:1fr}
  .site-footer .container{grid-template-columns:1fr}
  .section{padding:44px 0}
}

/* 모바일 (≤640) — 모바일 최적화 기준 */
@media (max-width:640px){
  .container{padding:0 16px}
  .section{padding:34px 0}
  .section-head{flex-direction:column;align-items:flex-start;gap:6px;margin-bottom:18px}
  .section-title{font-size:1.42rem}
  .section-title::before{height:22px}

  /* 헤더/모바일 메뉴 */
  .nav-toggle{display:block}
  .site-header .container{min-height:62px}
  .primary-nav{display:none;position:absolute;top:100%;left:0;right:0;
    background:var(--navy);padding:8px;box-shadow:0 10px 22px rgba(0,0,0,.35);
    max-height:72vh;overflow:auto;border-top:1px solid rgba(255,255,255,.12)}
  .primary-nav.open{display:block}
  .primary-nav ul{flex-direction:column;gap:2px}
  .primary-nav a{padding:13px 16px;font-size:1rem}
  .site-brand{font-size:1.15rem}
  .site-brand .custom-logo{height:42px;max-width:180px}

  /* 슬라이더 */
  .hero-slider{height:300px}
  .slide .meta{padding:18px 18px 30px}
  .slide h2{font-size:1.28rem;max-width:100%;margin:8px 0 4px}
  .slide .by{font-size:.82rem}
  .hero-nav{width:38px;height:38px;font-size:1.4rem}
  .hero-nav.prev{left:8px}.hero-nav.next{right:8px}

  /* 목록류 */
  .recent-grid{grid-template-columns:repeat(2,1fr);gap:12px}
  .recent-card h3{font-size:.92rem}
  .sponsor-list{grid-template-columns:1fr;gap:0}
  .post-row{grid-template-columns:1fr}
  .post-row .th{aspect-ratio:16/9}

  /* 카드 그리드는 2열 유지(콤팩트) */
  .yt-grid,.branch-grid,.sponsor-grid{grid-template-columns:repeat(2,1fr);gap:12px}
  .yt-shorts{grid-template-columns:repeat(3,1fr);gap:10px}
  .sponsor-card .photo{width:84px;height:84px}

  /* 글/기자 상세 */
  .single{padding:20px}
  .single h1{font-size:1.5rem}
  .author-head{flex-direction:column;text-align:center;padding:20px}
}

/* 좁은 폰 (≤400) */
@media (max-width:400px){
  .yt-grid,.recent-grid{grid-template-columns:1fr}
  .hero-slider{height:240px}
  .slide h2{font-size:1.16rem}
}
