/*
Theme Name: IdealTech Theme
Theme URI: https://github.com/idealtech/theme
Author: IdealTech
Author URI: https://idealtech.com
Description: A high-performance, secure, and SEO-optimized WordPress theme built for Elementor. Features a clean, responsive CSS Grid layout, modern typography, and an elegant default Indigo & Slate design.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: idealtech-theme
Tags: custom-colors, custom-menu, custom-logo, grid-layout, elementor, translation-ready, accessibility-ready, blog
*/

/* ==========================================================================
   1. Design Tokens & CSS Custom Properties
   ========================================================================== */
:root {
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-heading: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: #e0e7ff;
  --color-secondary: #0ea5e9;
  --color-secondary-hover: #0284c7;
  --color-background: #ffffff;
  --color-surface: #f8fafc;
  --color-surface-hover: #f1f5f9;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  --border-radius-sm: 0.375rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 0.75rem;
  
  --container-width: 1200px;
  --header-height: 80px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-background: #0f172a;
    --color-surface: #1e293b;
    --color-surface-hover: #334155;
    --color-text: #f8fafc;
    --color-text-muted: #94a3b8;
    --color-border: #334155;
    --color-primary-light: #1e1b4b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
  }
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
  color: var(--color-primary-hover);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1.25rem;
}

ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

/* ==========================================================================
   3. Typography & Utilities
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--color-surface);
  clip: auto !important;
  clip-path: none;
  color: var(--color-text);
  display: block;
  font-size: 0.875rem;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  position: absolute;
  top: 5px;
  text-decoration: none;
  width: auto;
  z-index: 100000;
}

/* ==========================================================================
   4. Header & Navigation (Fallback Style)
   ========================================================================== */
.site-header {
  background-color: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: var(--shadow-sm);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.site-branding .custom-logo-link img {
  max-height: 48px;
  width: auto;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0;
}

.site-title a {
  color: var(--color-text);
}

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin-bottom: 0;
  padding-left: 0;
}

.main-navigation a {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  position: relative;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  color: var(--color-primary);
}

.main-navigation a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-fast);
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  margin: 5px 0;
  transition: var(--transition-fast);
}

/* ==========================================================================
   5. Content Layout & Grid
   ========================================================================== */
.site-content {
  padding: 4rem 0;
  min-height: calc(100vh - var(--header-height) - 150px);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
}

.post-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.post-thumbnail img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-card-content {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-meta {
  font-size: 0.825rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  gap: 1rem;
}

.post-card-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.post-card-title a {
  color: var(--color-text);
}

.post-card-title a:hover {
  color: var(--color-primary);
}

.post-excerpt {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.read-more {
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   6. Article / Single Post Layout
   ========================================================================== */
.single-post-container {
  max-width: 800px;
  margin: 0 auto;
}

.entry-header {
  margin-bottom: 2.5rem;
  text-align: center;
}

.entry-title {
  font-size: 2.75rem;
  margin-bottom: 1rem;
}

.entry-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.entry-thumbnail {
  margin-bottom: 2.5rem;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.entry-content {
  font-size: 1.125rem;
  line-height: 1.8;
}

.entry-content p {
  margin-bottom: 1.5rem;
}

.entry-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cat-links, .tags-links {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ==========================================================================
   7. Form Controls (Comments, Search, Widgets)
   ========================================================================== */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  background-color: var(--color-background);
  color: var(--color-text);
  border-radius: var(--border-radius-md);
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.button,
input[type="submit"],
button {
  display: inline-block;
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.button:hover,
input[type="submit"]:hover,
button:hover {
  background-color: var(--color-primary-hover);
}

.button:active,
input[type="submit"]:active,
button:active {
  transform: scale(0.98);
}

/* ==========================================================================
   8. Footer Layout
   ========================================================================== */
.site-footer {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 3rem 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-navigation ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  padding-left: 0;
}

.footer-navigation a {
  color: var(--color-text-muted);
}

.footer-navigation a:hover {
  color: var(--color-primary);
}

/* ==========================================================================
   9. Media Queries
   ========================================================================== */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  
  .menu-toggle {
    display: block;
  }
  
  .main-navigation {
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background-color: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
  }
  
  .main-navigation.active {
    max-height: 400px;
    box-shadow: var(--shadow-md);
  }
  
  .main-navigation ul {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
  }
  
  .main-navigation a::after {
    display: none;
  }
}
