/*
Theme Name: ScreenTimer
Theme URI: https://screentimer.net
Author: ScreenTimer
Author URI: https://screentimer.net
Description: A modern, high-performance WordPress theme for online timer, stopwatch, Pomodoro, and productivity tools. Features a dark/light theme engine, fullscreen countdown timer, multi-timer, 8 color themes, preferences panel, browser tab countdown, and a clean blog layout optimized for AdSense integration.
Version: 1.4.2
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: screentimer
Tags: one-column, custom-menu, featured-images, full-width-template, blog, education, portfolio
*/

/* ═══════════════════════════════════════════════════════
   CSS VARIABLES
   ═══════════════════════════════════════════════════════ */
:root {
  --tf-bg: #0A0A0F;
  --tf-card: #12121A;
  --tf-border: #1E1E2A;
  --tf-text: #F0EDE6;
  --tf-muted: #6A6A7A;
  --tf-accent: #E8A838;
  --tf-danger: #E84848;
  --tf-success: #4ADE80;
  --tf-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --tf-font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Courier New', monospace;
  --tf-max-width: 1200px;
  --tf-content-width: 800px;
  --tf-header-height: 64px;
}

/* ═══════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--tf-font-sans);
  background: var(--tf-bg);
  color: var(--tf-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--tf-accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ═══════════════════════════════════════════════════════
   SITE HEADER
   ═══════════════════════════════════════════════════════ */
.tf-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--tf-bg);
  border-bottom: 1px solid var(--tf-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.tf-header-inner {
  max-width: var(--tf-max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--tf-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tf-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--tf-text);
}
.tf-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--tf-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--tf-bg);
}
.tf-logo span { color: var(--tf-accent); }

/* Navigation */
.tf-nav { display: flex; align-items: center; gap: 8px; }
.tf-nav a, .tf-nav button {
  color: var(--tf-muted);
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.tf-nav a:hover, .tf-nav button:hover { color: var(--tf-text); background: var(--tf-card); }
.tf-nav a.active, .tf-nav button.active { color: var(--tf-bg); background: var(--tf-accent); font-weight: 600; }

/* Mobile menu */
.tf-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--tf-border);
  color: var(--tf-muted);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 20px;
  align-items: center;
  justify-content: center;
}
@media (max-width: 768px) {
  .tf-menu-toggle { display: flex; }
  .tf-nav {
    position: absolute;
    top: var(--tf-header-height);
    left: 0;
    right: 0;
    background: var(--tf-bg);
    border-bottom: 1px solid var(--tf-border);
    flex-direction: column;
    padding: 12px 24px;
    display: none;
  }
  .tf-nav.open { display: flex; }
  .tf-nav a, .tf-nav button { width: 100%; text-align: left; padding: 12px 16px; }
}

/* ═══════════════════════════════════════════════════════
   TOOL EMBED SECTION
   ═══════════════════════════════════════════════════════ */
.tf-tool-section {
  width: 100%;
  min-height: calc(100vh - var(--tf-header-height) - 60px);
  display: flex;
  flex-direction: column;
}
.tf-tool-frame {
  flex: 1;
  width: 100%;
  border: none;
  min-height: 600px;
}

/* ═══════════════════════════════════════════════════════
   CONTENT PAGES & BLOG
   ═══════════════════════════════════════════════════════ */
.tf-content-wrap {
  max-width: var(--tf-max-width);
  margin: 0 auto;
  padding: 40px 24px;
}
.tf-content-narrow {
  max-width: var(--tf-content-width);
  margin: 0 auto;
}

/* Blog listing */
.tf-blog-header {
  margin-bottom: 40px;
}
.tf-blog-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}
.tf-blog-header p {
  font-size: 16px;
  color: var(--tf-muted);
  line-height: 1.6;
}
.tf-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
@media (max-width: 480px) {
  .tf-posts-grid { grid-template-columns: 1fr; }
}

/* Post card */
.tf-post-card {
  background: var(--tf-card);
  border: 1px solid var(--tf-border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.tf-post-card:hover {
  border-color: var(--tf-accent);
  transform: translateY(-2px);
}
.tf-post-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--tf-border);
}
.tf-post-card-body { padding: 20px; }
.tf-post-card-cat {
  font-size: 11px;
  font-weight: 600;
  color: var(--tf-accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.tf-post-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--tf-text);
  line-height: 1.3;
  margin-bottom: 10px;
}
.tf-post-card-title a { color: var(--tf-text); }
.tf-post-card-title a:hover { color: var(--tf-accent); }
.tf-post-card-excerpt {
  font-size: 14px;
  color: var(--tf-muted);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tf-post-card-meta {
  font-size: 12px;
  color: var(--tf-muted);
  display: flex;
  gap: 12px;
}

/* Single post */
.tf-single-header { margin-bottom: 32px; }
.tf-single-cat {
  font-size: 12px;
  font-weight: 600;
  color: var(--tf-accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: inline-block;
}
.tf-single-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}
@media (max-width: 480px) {
  .tf-single-title { font-size: 26px; }
}
.tf-single-meta {
  font-size: 14px;
  color: var(--tf-muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Post content */
.tf-post-content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--tf-text);
}
.tf-post-content p { margin-bottom: 20px; }
.tf-post-content h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 36px 0 16px;
  color: var(--tf-text);
}
.tf-post-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--tf-text);
}
.tf-post-content ul, .tf-post-content ol {
  margin: 16px 0;
  padding-left: 24px;
}
.tf-post-content li { margin-bottom: 8px; }
.tf-post-content blockquote {
  border-left: 3px solid var(--tf-accent);
  padding: 16px 20px;
  margin: 24px 0;
  background: var(--tf-card);
  border-radius: 0 8px 8px 0;
  color: var(--tf-muted);
  font-style: italic;
}
.tf-post-content code {
  background: var(--tf-card);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--tf-font-mono);
  font-size: 0.9em;
  color: var(--tf-accent);
}
.tf-post-content pre {
  background: var(--tf-card);
  border: 1px solid var(--tf-border);
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
}
.tf-post-content pre code {
  background: none;
  padding: 0;
  color: var(--tf-text);
}
.tf-post-content img {
  border-radius: 10px;
  margin: 24px 0;
}
.tf-post-content a { color: var(--tf-accent); text-decoration: underline; text-underline-offset: 2px; }

/* ═══════════════════════════════════════════════════════
   AD SLOTS
   ═══════════════════════════════════════════════════════ */
.tf-ad-slot {
  background: var(--tf-card);
  border: 1px dashed var(--tf-border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  color: var(--tf-muted);
  font-size: 12px;
  margin: 28px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tf-ad-slot-header {
  margin: 0 auto;
  max-width: var(--tf-max-width);
  padding: 8px 24px;
}
.tf-ad-slot-sidebar { margin-bottom: 20px; }

/* ═══════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════ */
.tf-layout-sidebar {
  max-width: var(--tf-max-width);
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
}
@media (max-width: 900px) {
  .tf-layout-sidebar { grid-template-columns: 1fr; }
}
.tf-sidebar-widget {
  background: var(--tf-card);
  border: 1px solid var(--tf-border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}
.tf-sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tf-text);
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}
.tf-sidebar-links { list-style: none; }
.tf-sidebar-links li {
  padding: 8px 0;
  border-bottom: 1px solid var(--tf-border);
}
.tf-sidebar-links li:last-child { border-bottom: none; }
.tf-sidebar-links a {
  color: var(--tf-muted);
  font-size: 14px;
  transition: color 0.2s;
}
.tf-sidebar-links a:hover { color: var(--tf-accent); }

/* ═══════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════ */
.tf-site-footer {
  border-top: 1px solid var(--tf-border);
  background: var(--tf-bg);
  padding: 40px 24px;
}
.tf-footer-inner {
  max-width: var(--tf-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}
.tf-footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--tf-text);
  margin-bottom: 16px;
}
.tf-footer-col ul { list-style: none; }
.tf-footer-col li { margin-bottom: 8px; }
.tf-footer-col a { color: var(--tf-muted); font-size: 14px; }
.tf-footer-col a:hover { color: var(--tf-accent); }
.tf-footer-bottom {
  max-width: var(--tf-max-width);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--tf-border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--tf-muted);
}

/* ═══════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════ */
.tf-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}
.tf-pagination a, .tf-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--tf-border);
  font-size: 14px;
  color: var(--tf-muted);
  transition: all 0.2s;
}
.tf-pagination a:hover { border-color: var(--tf-accent); color: var(--tf-accent); }
.tf-pagination .current {
  background: var(--tf-accent);
  color: var(--tf-bg);
  border-color: var(--tf-accent);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════════ */
.tf-breadcrumbs {
  font-size: 13px;
  color: var(--tf-muted);
  margin-bottom: 24px;
}
.tf-breadcrumbs a { color: var(--tf-muted); }
.tf-breadcrumbs a:hover { color: var(--tf-accent); }
.tf-breadcrumbs .sep { margin: 0 8px; }
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}
