/* ═══════════════════════════════════════════
   THE LOADING TIMES — Main Stylesheet
   Dark theme news blog
═══════════════════════════════════════════ */

:root {
  --bg:        #0d0d0d;
  --bg2:       #141414;
  --bg3:       #1a1a1a;
  --bg4:       #222222;
  --border:    #2a2a2a;
  --text:      #e8e8e8;
  --text-muted:#888888;
  --text-dim:  #555555;
  --green:     #3ddc84;
  --green-dark:#2ab36a;
  --red:       #ff4545;
  --accent:    #3ddc84;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;
  --font-ui:   'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --radius:    8px;
  --shadow:    0 4px 20px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; }

/* ── LAYOUT ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.layout-main {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  padding: 40px 0;
}

@media (max-width: 900px) {
  .layout-main { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* ── HEADER ── */
.site-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.logo img { width: 32px; height: 32px; border-radius: 6px; }
.logo span { color: var(--green); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: var(--bg3);
}

.header-search {
  display: flex;
  align-items: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  gap: 8px;
}

.header-search input {
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  width: 180px;
  outline: none;
}

.header-search input::placeholder { color: var(--text-dim); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg2); border-bottom: 1px solid var(--border); flex-direction: column; padding: 12px; gap: 4px; }
  .nav-links.open { display: flex; }
  .header-search { display: none; }
}

/* ── HERO SLIDER ── */
.hero-section {
  position: relative;
  overflow: hidden;
  background: var(--bg2);
  height: 480px;
}

@media (max-width: 768px) { .hero-section { height: 300px; } }

.hero-slider-track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.hero-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 40px;
  text-align: center;
}

.hero-content h2 {
  font-size: clamp(22px, 4vw, 42px);
  color: #fff;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.hero-content .meta { color: rgba(255,255,255,0.6); font-size: 13px; justify-content: center; display: flex; gap: 8px; }

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}

.hero-arrow:hover { background: rgba(0,0,0,0.8); }
.hero-arrow.prev { left: 16px; }
.hero-arrow.next { right: 16px; }

.hero-controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: background 0.2s, transform 0.2s;
}

.hero-dot.active {
  background: var(--green);
  transform: scale(1.3);
}

.hero-timer-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.1);
  z-index: 10;
}

.hero-timer-bar {
  height: 100%;
  background: var(--green);
  width: 0%;
  transition: width 0.1s linear;
}

/* ── SECTION HEADER ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 22px;
  color: var(--text);
}

/* ── CARDS GRID ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--green);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--bg3);
}

.card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 1px;
}

.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }

.card-cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 8px;
}

.card-title {
  font-family: var(--font-head);
  font-size: 16px;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 8px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: auto;
}

.card-meta .views::before { content: '👁 '; }

/* ── CAT TAG ── */
.cat-tag {
  display: inline-block;
  background: var(--green);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

/* ── CATEGORIES GRID ── */
.cats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

@media (max-width: 768px) { .cats-grid { grid-template-columns: repeat(2, 1fr); } }

.cat-card {
  background: var(--bg3);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.cat-card img { width: 100%; height: 140px; object-fit: cover; }

.cat-card-placeholder {
  width: 100%;
  height: 140px;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.cat-card-body { padding: 16px; }

.cat-card h3 {
  font-family: var(--font-head);
  font-size: 18px;
  color: var(--text);
  margin-bottom: 4px;
}

.cat-card p { font-size: 12px; color: var(--text-muted); }

/* ── PAGINATION ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.pagination button {
  padding: 10px 24px;
  border-radius: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  transition: background 0.2s, border-color 0.2s;
}

.pagination button:hover:not(:disabled) {
  background: var(--bg4);
  border-color: var(--green);
}

.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── NEWSLETTER ── */
.newsletter-section {
  background: var(--bg3);
  border-radius: 12px;
  padding: 40px;
  margin-bottom: 40px;
  text-align: center;
}

.newsletter-section h2 {
  font-size: 26px;
  margin-bottom: 10px;
}

.newsletter-section p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 14px;
}

.nl-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  max-width: 500px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.nl-form input {
  flex: 1;
  min-width: 140px;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.nl-form input:focus { border-color: var(--green); }

/* ── SIDEBAR ── */
.sidebar { padding-top: 40px; }

.sidebar-widget {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.sidebar-widget h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-post {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.sidebar-post:last-child { border-bottom: none; }

.sidebar-post img {
  width: 60px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--bg3);
}

.sidebar-post-title {
  font-family: var(--font-head);
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-post-date { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.tag-pill {
  display: inline-block;
  padding: 5px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s;
}

.tag-pill:hover { color: var(--green); border-color: var(--green); }

/* ── ARTICLE PAGE ── */
.article-header { padding: 40px 0 30px; }

.article-header .cat-tag { margin-bottom: 16px; }

.article-title {
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.15;
  margin-bottom: 20px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.article-cover {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 40px;
}

.article-body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
}

.article-body h2, .article-body h3 {
  font-family: var(--font-head);
  margin: 2em 0 0.75em;
  color: var(--text);
}

.article-body h2 { font-size: 26px; }
.article-body h3 { font-size: 21px; }

.article-body p { margin-bottom: 1.5em; }

.article-body a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }

.article-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 24px 0;
}

.article-body blockquote {
  border-left: 3px solid var(--green);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--bg2);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-muted);
}

.article-body code {
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--green);
}

.article-body pre {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
}

.article-body pre code { background: none; padding: 0; color: var(--text); }

.article-body ul, .article-body ol {
  padding-left: 24px;
  margin-bottom: 1.5em;
}

.article-body li { margin-bottom: 6px; }

.article-tags { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 8px; }

.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 60px;
  align-items: start;
}

@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s, transform 0.1s;
  cursor: pointer;
  border: none;
}

.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.98); }

.btn-green { background: var(--green); color: #000; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--green); color: var(--green); }
.btn-red { background: var(--red); color: #fff; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
  grid-column: 1 / -1;
}

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 16px 0;
}

.breadcrumb a { color: var(--green); }
.breadcrumb span { color: var(--text-dim); }

/* ── SEARCH PAGE ── */
.search-bar-big {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
}

.search-bar-big input {
  flex: 1;
  padding: 14px 18px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  font-size: 16px;
  font-family: var(--font-ui);
  outline: none;
}

.search-bar-big input:focus { border-color: var(--green); }

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 520px;
  width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.modal-body { padding: 30px; }

/* ── FOOTER ── */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
  margin-top: 12px;
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 13px; color: var(--text-muted); transition: color 0.2s; }
.footer-col a:hover { color: var(--green); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 10px;
}

/* ── PAGE SPECIFIC ── */
.page-hero {
  padding: 60px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.page-hero h1 { font-size: clamp(28px, 5vw, 48px); margin-bottom: 12px; }
.page-hero p { color: var(--text-muted); font-size: 16px; max-width: 500px; margin: 0 auto; }

/* ── STATIC CONTENT PAGES ── */
.static-content {
  max-width: 740px;
  margin: 0 auto;
  padding: 40px 0 80px;
}

.static-content h1 { font-size: 36px; margin-bottom: 10px; }
.static-content h2 { font-size: 22px; margin: 32px 0 12px; }
.static-content p { color: var(--text-muted); line-height: 1.8; margin-bottom: 16px; font-family: var(--font-body); font-size: 16px; }
.static-content ul { padding-left: 20px; color: var(--text-muted); font-family: var(--font-body); font-size: 16px; }
.static-content li { margin-bottom: 8px; }

/* ── LOADING SPINNER ── */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  max-width: 300px;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

/* ── UTILITIES ── */
.text-green { color: var(--green); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-40 { margin-top: 40px; }
.mb-40 { margin-bottom: 40px; }
.hidden { display: none !important; }
