/*
Theme Name: Tech Weeklys
Theme URI: https://techweeklys.com
Author: Tech Weeklys Team
Author URI: https://techweeklys.com
Description: Standalone, modern magazine and technology publication theme. Features high-impact 3-column magazine layout, dark featured carousels, reading progress indicator, dark/light theme switching, reading list bookmarks, automated setup engine, and full Gutenberg support.
Version: 1.1.17
Tested up to: 6.7
Requires at least: 6.0
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: tech-weeklys
Tags: news, blog, magazine, two-columns, three-columns, grid-layout, custom-menu, featured-images, translation-ready, theme-options
*/

/* ==========================================================================
   1. Google Fonts & CSS Custom Properties (OKLCH with RGB Fallbacks)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,600;0,700;0,800;0,900;1,700;1,800&family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400&display=swap');

:root {
  /* Brand Amber/Gold Accents - RGB Fallback + OKLCH */
  --color-primary: #d97706;
  --color-primary: oklch(68.5% 0.17 65.4);
  --color-primary-hover: #b45309;
  --color-primary-hover: oklch(56.8% 0.16 57.2);
  --color-primary-light: #fef3c7;
  --color-primary-light: oklch(96.2% 0.04 88.5);
  --color-primary-glow: rgba(217, 119, 6, 0.25);
  --color-accent-badge: #0f172a;

  /* Surfaces & Backgrounds - Light Mode */
  --bg-body: #ffffff;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-subtle: oklch(98.2% 0.005 247.8);
  --bg-muted: #f1f5f9;
  --bg-muted: oklch(96.4% 0.01 248.5);
  --bg-card: #ffffff;
  --bg-alt-section: #f8fafc;
  --bg-frosted: rgba(255, 255, 255, 0.85);

  /* Typography Colors */
  --text-primary: #0f172a;
  --text-primary: oklch(20.5% 0.04 265.8);
  --text-secondary: #334155;
  --text-secondary: oklch(37.5% 0.04 257.3);
  --text-muted: #64748b;
  --text-muted: oklch(55.4% 0.04 257.4);
  --text-inverse: #ffffff;

  /* Borders & Dividers */
  --border-color: #e2e8f0;
  --border-color: oklch(92.8% 0.01 255.6);
  --border-strong: #0f172a;
  --border-subtle: #edf2f7;

  /* Status Colors */
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-info: #0284c7;

  /* Footer Colors */
  --footer-bg: #090d16;
  --footer-surface: #111827;
  --footer-text: #94a3b8;
  --footer-text-light: #e2e8f0;
  --footer-border: rgba(255, 255, 255, 0.12);

  /* Typography Font Stacks */
  --font-display: 'Barlow Condensed', sans-serif, system-ui;
  --font-sans: 'DM Sans', sans-serif, system-ui;
  --font-serif: 'Merriweather', Georgia, serif;

  /* Spacing Tokens */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;

  /* Layout & Sizing */
  --container-max-width: 1240px;
  --site-header-height: 80px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Elevation Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-body: #0a0e17;
  --bg-surface: #111726;
  --bg-subtle: #161e31;
  --bg-muted: #1c263c;
  --bg-card: #111726;
  --bg-alt-section: #0e1422;
  --bg-frosted: rgba(10, 14, 23, 0.88);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --border-color: #232e44;
  --border-strong: #f8fafc;
  --border-subtle: #1c2538;

  --color-primary: #f59e0b;
  --color-primary: oklch(75.5% 0.18 70.2);
  --color-primary-hover: #fbbf24;
  --color-primary-light: #2c210d;
  --color-primary-glow: rgba(245, 158, 11, 0.3);
  --color-accent-badge: #f59e0b;

  --footer-bg: #06080e;
  --footer-surface: #0a0e17;
  --footer-border: rgba(255, 255, 255, 0.08);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   2. Reset & Base Typography
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

img, picture, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Universal SVG Icon Sizing Safeguards */
.story-time svg,
.card-time svg,
.featured-time svg,
.dw-featured-info .story-time svg,
.dw-left-col .story-time svg,
.compact-meta .story-time svg,
.dark-byline .story-time svg,
.dark-side-meta .story-time svg,
.cat-hero-meta svg,
.single-meta-item svg,
.live-date svg,
.current-date svg,
.trending-badge svg,
.top-saved-btn svg {
  width: 13px !important;
  height: 13px !important;
  min-width: 13px !important;
  min-height: 13px !important;
  max-width: 13px !important;
  max-height: 13px !important;
  display: inline-block !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
}

.top-social-link svg {
  width: 14px !important;
  height: 14px !important;
}

.open-search-btn svg,
.header-search-bar button svg {
  width: 15px !important;
  height: 15px !important;
}

.btn-icon svg {
  width: 18px !important;
  height: 18px !important;
}

.mobile-menu-btn svg {
  width: 20px !important;
  height: 20px !important;
}

.modal-close-btn svg {
  width: 18px !important;
  height: 18px !important;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button, input, select, textarea {
  font: inherit;
  /* Prevent iOS Safari 16px auto-zoom */
  font-size: 1rem;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Clamped Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 4vw + 1rem, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2.25rem); font-weight: 800; }
h3 { font-size: clamp(1.2rem, 1.8vw + 0.2rem, 1.6rem); font-weight: 700; }
h4 { font-size: clamp(1.05rem, 1.2vw + 0.1rem, 1.3rem); font-weight: 700; }

/* Layout Wrappers */
.page-wrap {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 3vw, 2rem);
  padding-right: clamp(1rem, 3vw, 2rem);
}

/* Touch targets & Form inputs */
.btn, .btn-submit, .share-btn, .theme-toggle-btn, .modal-close-btn {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  font-size: 16px; /* Strict iOS auto-zoom prevention */
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-primary);
  padding: 10px 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

/* Viewport Scroll Reveal Utility */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reading Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--color-primary);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease-out;
}
