/*
Theme Name: Tazzatoto
Theme URI: https://tazzatoto.com/
Author: tazzatoto
Description: Lightweight ColorMag-like magazine theme for the tazzatoto.com restore. Not ColorMag.
Version: 1.0.3
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: tazzatoto
*/

:root {
  --tz-accent: #cf2e2e;
  --tz-accent-dark: #a32424;
  --tz-ink: #1a1a1a;
  --tz-muted: #666;
  --tz-line: #e5e5e5;
  --tz-bg: #eef0f2;
  --tz-surface: #fff;
  --tz-nav: #222;
  --tz-max: 1100px;
  --tz-font: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--tz-font);
  color: var(--tz-ink);
  background: var(--tz-bg);
  line-height: 1.65;
  font-size: 16px;
}

a {
  color: var(--tz-accent);
  text-decoration: none;
}

a:hover {
  color: var(--tz-accent-dark);
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.tz-page {
  background: var(--tz-surface);
  width: min(100%, var(--tz-max));
  margin-inline: auto;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.06);
}

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

.tz-page > .tz-wrap,
.tz-page .tz-header-inner,
.tz-page .tz-topbar-inner,
.tz-page .tz-nav .tz-wrap,
.tz-page .tz-footer-inner {
  width: 100%;
  padding-inline: 1rem;
  box-sizing: border-box;
}

/* Top bar / ticker */
.tz-topbar {
  background: #f4f4f4;
  color: #444;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--tz-line);
}

.tz-topbar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 2.25rem;
  overflow: hidden;
}

.tz-topbar-date {
  flex: 0 0 auto;
  color: var(--tz-muted);
}

.tz-topbar-label {
  flex: 0 0 auto;
  background: var(--tz-accent);
  color: #fff;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
}

.tz-ticker {
  display: flex;
  gap: 1.25rem;
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
}

.tz-ticker a {
  color: #333;
}

.tz-ticker a:hover {
  color: var(--tz-accent);
}

/* Header: logo left, 728 ad right */
.tz-header {
  background: var(--tz-surface);
}

.tz-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 1rem;
}

.tz-brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 0 1 auto;
}

.tz-brand a {
  color: var(--tz-ink);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.tz-brand .custom-logo-link img,
.tz-brand .custom-logo {
  max-height: 90px;
  width: auto;
}

body.wp-custom-logo .tz-site-title,
body.wp-custom-logo .tz-tagline {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.tz-tagline {
  color: var(--tz-muted);
  font-size: 0.8125rem;
}

.tz-header-ad {
  flex: 0 1 728px;
  max-width: 728px;
  text-align: right;
}

.tz-header-ad .tazzatoto-ad--leaderboard {
  margin: 0;
  width: auto;
}

/* Nav */
.tz-nav {
  background: var(--tz-nav);
}

.tz-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.tz-nav li {
  position: relative;
}

.tz-nav a {
  display: block;
  color: #fff;
  padding: 0.75rem 0.9rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.tz-nav a:hover,
.tz-nav .current-menu-item > a,
.tz-nav .current-cat > a {
  background: var(--tz-accent);
  color: #fff;
}

.tz-nav .sub-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 14rem;
  background: #111;
  z-index: 30;
  flex-direction: column;
}

.tz-nav .sub-menu .sub-menu {
  left: 100%;
  top: 0;
}

.tz-nav li:hover > .sub-menu {
  display: flex;
}

.tz-nav .sub-menu a {
  white-space: nowrap;
  font-size: 0.8125rem;
  padding: 0.55rem 0.9rem;
}

/* Magazine home */
.tz-main {
  padding: 1.25rem 1rem 2.5rem;
}

.tz-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.tz-card {
  background: var(--tz-surface);
  border: 1px solid var(--tz-line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tz-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.tz-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #ddd;
  overflow: hidden;
}

.tz-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tz-card-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, var(--tz-accent) 0%, var(--tz-accent-dark) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 1rem;
  text-align: center;
  line-height: 1.3;
}

.tz-badge {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  background: var(--tz-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  z-index: 1;
}

.tz-card-body {
  padding: 0.9rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.tz-card-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 700;
}

.tz-card-title a {
  color: var(--tz-ink);
}

.tz-card-title a:hover {
  color: var(--tz-accent);
}

.tz-card-meta {
  color: var(--tz-muted);
  font-size: 0.8125rem;
}

.tz-hero-main .tz-card-title {
  font-size: 1.5rem;
}

.tz-hero-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 1rem;
}

.tz-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.tz-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 800;
}

.tz-section-title::after {
  content: "";
  flex: 1;
  height: 3px;
  background: var(--tz-accent);
}

/* Single / archive */
.tz-content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.5rem;
}

.tz-article {
  background: var(--tz-surface);
  border: 1px solid var(--tz-line);
  padding: 1.5rem;
}

.tz-article-header {
  margin-bottom: 1.25rem;
}

.tz-article-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.tz-article-cats a {
  background: var(--tz-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
}

.tz-article-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.25;
}

.tz-article-meta {
  color: var(--tz-muted);
  font-size: 0.875rem;
}

.tz-featured {
  margin: 0 0 1.25rem;
}

.tz-featured img {
  width: 100%;
  display: block;
}

.tz-entry {
  font-size: 1.05rem;
}

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

.tz-entry h2,
.tz-entry h3 {
  line-height: 1.3;
}

.tz-entry figure {
  margin: 1.25rem 0;
}

.tz-entry ul,
.tz-entry ol {
  padding-left: 1.25rem;
}

.tz-sidebar .tz-widget {
  background: var(--tz-surface);
  border: 1px solid var(--tz-line);
  padding: 1rem;
  margin-bottom: 1rem;
}

.tz-widget h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  border-left: 3px solid var(--tz-accent);
  padding-left: 0.5rem;
}

.tz-widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tz-widget li {
  border-bottom: 1px solid var(--tz-line);
  padding: 0.5rem 0;
}

.tz-widget li:last-child {
  border-bottom: 0;
}

.tz-pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
}

.tz-pagination a,
.tz-pagination span {
  background: var(--tz-surface);
  border: 1px solid var(--tz-line);
  padding: 0.4rem 0.75rem;
  color: var(--tz-ink);
}

.tz-pagination .current {
  background: var(--tz-accent);
  border-color: var(--tz-accent);
  color: #fff;
}

/* Footer */
.tz-footer {
  background: #1b1b1b;
  color: #bbb;
  padding: 2rem 0;
  border-top: 3px solid var(--tz-accent);
}

.tz-footer a {
  color: #ddd;
}

.tz-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
}

.tz-footer-about {
  max-width: 36rem;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .tz-hero,
  .tz-grid,
  .tz-content-layout {
    grid-template-columns: 1fr;
  }

  .tz-hero-side {
    grid-template-rows: none;
    grid-template-columns: 1fr 1fr;
  }

  .tz-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .tz-header-ad {
    flex: 0 1 auto;
    max-width: 100%;
    width: 100%;
  }

  .tz-nav .sub-menu {
    position: static;
  }
}

@media (max-width: 600px) {
  .tz-hero-side,
  .tz-grid {
    grid-template-columns: 1fr;
  }
}
