/* Techverian — IT/Tech News Theme
   Palette: Orange / White / Black
*/

:root {
  --tv-orange: #f25c05;
  --tv-orange-deep: #d94d00;
  --tv-orange-soft: #fff1e8;
  --tv-black: #0d0d0d;
  --tv-ink: #1a1a1a;
  --tv-muted: #5c5c5c;
  --tv-line: #e6e6e6;
  --tv-white: #ffffff;
  --tv-bg: #fafafa;
  --tv-radius: 2px;
  --tv-max: 1180px;
  --tv-narrow: 720px;
  --tv-font: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --tv-serif: "Source Serif 4", "Noto Serif KR", Georgia, serif;
  --tv-space: clamp(1rem, 2vw, 1.75rem);
  --tv-header: 4.25rem;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--tv-font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--tv-ink);
  background: var(--tv-white);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--tv-orange);
}

h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.container {
  width: min(100% - 2rem, var(--tv-max));
  margin-inline: auto;
}

.container.narrow,
.narrow {
  width: min(100% - 2rem, var(--tv-narrow));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--tv-black);
  color: var(--tv-white);
  padding: 0.75rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--tv-line);
}

.site-header__bar {
  border-bottom: 3px solid var(--tv-orange);
}

.site-header__inner {
  min-height: var(--tv-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.site-brand__logo img {
  max-height: 40px;
  width: auto;
}

.site-brand__text {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.1;
}

.site-brand__en {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--tv-black);
}

.site-brand__ko {
  font-size: 0.78rem;
  color: var(--tv-muted);
  margin-top: 0.15rem;
  letter-spacing: 0.04em;
}

.site-brand__text:hover .site-brand__en {
  color: var(--tv-orange);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--tv-line);
  background: var(--tv-white);
  padding: 0.55rem 0.8rem;
  font: inherit;
  cursor: pointer;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.primary-nav__list {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav__list a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.search-form {
  display: flex;
  border: 1px solid var(--tv-line);
  background: var(--tv-bg);
}

.search-form__input {
  border: 0;
  background: transparent;
  padding: 0.45rem 0.7rem;
  min-width: 10rem;
  font: inherit;
}

.search-form__submit {
  border: 0;
  border-left: 1px solid var(--tv-line);
  background: var(--tv-black);
  color: var(--tv-white);
  padding: 0.45rem 0.8rem;
  font: inherit;
  cursor: pointer;
}

.search-form__submit:hover {
  background: var(--tv-orange);
}

/* Topic nav */
.topic-nav {
  background: var(--tv-black);
  color: var(--tv-white);
}

.topic-nav__inner {
  overflow-x: auto;
}

.topic-nav__list {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  white-space: nowrap;
}

.topic-nav__link,
.topic-nav a {
  display: inline-block;
  padding: 0.55rem 0.85rem;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  border-bottom: 2px solid transparent;
}

.topic-nav a:hover,
.topic-nav .current-menu-item > a,
.topic-nav .current-cat > a {
  color: var(--tv-white);
  border-bottom-color: var(--tv-orange);
}

.topic-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--tv-orange);
  margin-bottom: 0.55rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn--primary {
  background: var(--tv-orange);
  color: var(--tv-white);
}

.btn--primary:hover {
  background: var(--tv-orange-deep);
  color: var(--tv-white);
  transform: translateY(-1px);
}

/* Home hero — full-bleed */
.home-hero {
  position: relative;
  min-height: min(78vh, 720px);
  display: grid;
  align-items: end;
  color: var(--tv-white);
  overflow: hidden;
  background: var(--tv-black);
}

.home-hero__media,
.home-hero__media img,
.home-hero__media--fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-hero__media--fallback {
  background:
    radial-gradient(circle at 20% 20%, rgba(242, 92, 5, 0.45), transparent 45%),
    linear-gradient(135deg, #1a1a1a, #0d0d0d 55%, #2a1408);
}

.home-hero__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 13, 13, 0.15) 0%, rgba(13, 13, 13, 0.78) 70%, rgba(13, 13, 13, 0.92) 100%);
}

.home-hero__content {
  position: relative;
  z-index: 1;
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3.5rem);
  max-width: 50rem;
  animation: tv-rise 0.8s ease both;
}

.home-hero__title {
  font-size: clamp(1.9rem, 4.5vw, 3.4rem);
  margin: 0 0 0.85rem;
  max-width: 16ch;
}

.home-hero__title a {
  text-decoration: none;
  color: var(--tv-white);
}

.home-hero__title a:hover {
  color: var(--tv-orange-soft);
}

.home-hero__excerpt {
  max-width: 42rem;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.05rem;
  margin: 0 0 1.25rem;
}

.home-hero .topic-label {
  color: var(--tv-orange);
  background: rgba(0, 0, 0, 0.25);
  padding: 0.2rem 0.45rem;
}

@keyframes tv-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sections */
.section {
  padding: clamp(2.5rem, 5vw, 4.5rem) 0;
}

.section__header {
  margin-bottom: 1.75rem;
  border-left: 4px solid var(--tv-orange);
  padding-left: 1rem;
}

.section__title {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
}

.section__lead {
  margin: 0.4rem 0 0;
  color: var(--tv-muted);
}

/* Cards / grid — not card-heavy; light separators */
.article-grid,
.topic-strip__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem 1.5rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: tv-rise 0.6s ease both;
}

.article-card:nth-child(2) { animation-delay: 0.05s; }
.article-card:nth-child(3) { animation-delay: 0.1s; }

.article-card__media {
  display: block;
  overflow: hidden;
  background: var(--tv-bg);
  aspect-ratio: 16 / 10;
}

.article-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.article-card:hover .article-card__media img {
  transform: scale(1.03);
}

.article-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #eee, #f7f7f7 40%, #ffe8d8);
}

.article-card__title {
  margin: 0;
  font-size: 1.15rem;
}

.article-card__title a {
  text-decoration: none;
}

.article-card__excerpt {
  margin: 0;
  color: var(--tv-muted);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card__meta {
  display: flex;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--tv-muted);
}

/* Topic immersion */
.topic-hero {
  background: var(--tv-black);
  color: var(--tv-white);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  position: relative;
  overflow: hidden;
}

.topic-hero::after {
  content: "";
  position: absolute;
  right: -10%;
  top: -30%;
  width: 45%;
  height: 160%;
  background: radial-gradient(circle, rgba(242, 92, 5, 0.35), transparent 65%);
  pointer-events: none;
}

.topic-hero__eyebrow {
  margin: 0 0 0.5rem;
  color: var(--tv-orange);
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}

.topic-hero__title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.topic-hero__desc {
  margin-top: 0.85rem;
  max-width: 40rem;
  color: rgba(255, 255, 255, 0.8);
}

.topic-strip {
  padding: 1.5rem 0 2.25rem;
  border-top: 1px solid var(--tv-line);
}

.topic-strip__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.topic-strip__title {
  margin: 0;
  font-size: 1.35rem;
}

.topic-strip__title a {
  text-decoration: none;
}

.topic-strip__more {
  color: var(--tv-orange);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
}

body.topic-ai .topic-nav,
body.topic-cloud .topic-nav,
body.topic-security .topic-nav {
  box-shadow: inset 0 -2px 0 var(--tv-orange);
}

/* Single article */
.article__header {
  padding: clamp(1.75rem, 3vw, 2.5rem) 0 1.5rem;
  margin: 0;
  text-align: left;
}

.article__main > .article__header {
  max-width: none;
}

.article__title {
  margin: 0.35rem 0 0.85rem;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
}

.article__dek {
  margin: 0;
  font-size: 1.15rem;
  color: var(--tv-muted);
  border-left: 3px solid var(--tv-orange);
  padding-left: 0.9rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--tv-muted);
  align-items: center;
}

.article-meta__by {
  margin-right: 0.35rem;
}

.article-meta__name {
  font-weight: 700;
  color: var(--tv-ink);
  text-decoration: none;
}

.article__figure {
  margin: 0 0 2rem;
}

.article__figure--inline {
  margin: 0 0 1.75rem;
}

.article__image,
.techverian-inline-hero img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  background: var(--tv-bg);
}

.techverian-inline-hero {
  margin: 0 0 1.75rem;
}

.article__caption {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
  color: var(--tv-muted);
}

.article__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 2.5rem;
  padding-top: 0.5rem;
  padding-bottom: 3.5rem;
  align-items: start;
}

.article__aside {
  padding-top: clamp(1.75rem, 3vw, 2.5rem);
}

.key-points {
  background: var(--tv-orange-soft);
  border-left: 4px solid var(--tv-orange);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.75rem;
}

.key-points__title {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.key-points__tldr {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--tv-ink);
}

.key-points__list {
  margin: 0;
  padding-left: 1.1rem;
}

.key-points__list li + li {
  margin-top: 0.35rem;
}

/* Prose — reading comfort */
.prose {
  font-family: var(--tv-serif);
  font-size: 1.125rem;
  line-height: 1.85;
  color: #222;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1.35rem;
}

.prose h2,
.prose h3 {
  font-family: var(--tv-font);
  margin: 2.25rem 0 0.85rem;
  color: var(--tv-black);
}

.prose h2 {
  font-size: 1.45rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--tv-line);
}

.prose h3 {
  font-size: 1.2rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1.35rem;
  padding-left: 1.3rem;
}

.prose blockquote {
  margin: 1.75rem 0;
  padding: 0.25rem 0 0.25rem 1.1rem;
  border-left: 3px solid var(--tv-orange);
  color: var(--tv-muted);
  font-style: italic;
}

.prose a {
  color: var(--tv-orange-deep);
}

.prose figure {
  margin: 1.75rem 0;
}

.prose figcaption {
  margin-top: 0.45rem;
  font-family: var(--tv-font);
  font-size: 0.85rem;
  color: var(--tv-muted);
}

.article-source {
  margin: 2rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--tv-line);
  border-bottom: 1px solid var(--tv-line);
  font-size: 0.92rem;
  color: var(--tv-muted);
}

.article-source__label {
  font-weight: 700;
  color: var(--tv-ink);
  margin-right: 0.5rem;
}

.article-faq {
  margin: 2.5rem 0;
}

.article-faq__item {
  border-top: 1px solid var(--tv-line);
  padding: 0.85rem 0;
}

.article-faq__item:last-child {
  border-bottom: 1px solid var(--tv-line);
}

.article-faq summary {
  cursor: pointer;
  font-weight: 700;
  font-family: var(--tv-font);
  list-style: none;
}

.article-faq summary::-webkit-details-marker {
  display: none;
}

.article-faq__question {
  display: inline;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.article-faq__answer {
  margin-top: 0.55rem;
  color: var(--tv-muted);
  font-family: var(--tv-font);
  font-size: 0.98rem;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}

.article-tags a {
  text-decoration: none;
  font-size: 0.88rem;
  color: var(--tv-muted);
}

.author-box {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1rem;
  padding: 1.25rem 0;
  border-top: 2px solid var(--tv-black);
}

.author-box__name {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.author-box__bio {
  margin: 0;
  color: var(--tv-muted);
  font-size: 0.95rem;
}

.author-box__avatar img {
  border-radius: 50%;
}

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

.related-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--tv-line);
}

.related-list a {
  display: block;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.related-list span {
  font-size: 0.8rem;
  color: var(--tv-muted);
}

.widget__title {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--tv-orange);
}

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--tv-line);
}

.article-nav a {
  text-decoration: none;
}

.article-nav .nav-label {
  display: block;
  font-size: 0.78rem;
  color: var(--tv-orange);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.pagination {
  margin-top: 2.5rem;
}

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.pagination .page-numbers {
  display: inline-flex;
  min-width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--tv-line);
  font-weight: 600;
}

.pagination .current {
  background: var(--tv-black);
  color: var(--tv-white);
  border-color: var(--tv-black);
}

/* Footer */
.site-footer {
  background: var(--tv-black);
  color: rgba(255, 255, 255, 0.82);
  margin-top: 2rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--tv-orange);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding: 3rem 0 2rem;
}

.site-footer__name-en {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--tv-white);
}

.site-footer__name-ko {
  margin: 0.2rem 0 0.75rem;
  color: var(--tv-orange);
  font-weight: 700;
}

.site-footer__desc {
  margin: 0;
  max-width: 28rem;
  line-height: 1.7;
}

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

.footer-nav li + li {
  margin-top: 0.45rem;
}

.site-footer__legal {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1rem 0 1.5rem;
  font-size: 0.85rem;
}

.site-footer__domain {
  color: var(--tv-orange);
  margin: 0.25rem 0 0;
}

.error-404 {
  padding: 5rem 0;
  text-align: center;
}

.error-404__code {
  font-size: 4rem;
  font-weight: 800;
  color: var(--tv-orange);
  margin: 0;
}

.page-article {
  padding: 3rem 0 4rem;
}

.page-article__title {
  margin: 0 0 1.5rem;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

/* Responsive */
@media (max-width: 960px) {
  .article-grid,
  .topic-strip__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .article__layout,
  .site-footer__grid {
    grid-template-columns: 1fr;
  }

  .article__aside {
    order: 2;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .primary-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--tv-header) + 3px);
    background: var(--tv-white);
    border-bottom: 1px solid var(--tv-line);
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
  }

  .primary-nav.is-open {
    display: flex;
  }

  .primary-nav__list {
    flex-direction: column;
  }

  .article-grid,
  .topic-strip__grid {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: 68vh;
  }

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

  .author-box {
    grid-template-columns: 56px 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
