/*
Theme Name:  IWT Lightning
Theme URI:   https://instantwebtools.co
Author:      Instant Web Tools, LLC
Author URI:  https://instantwebtools.co
Description: A super-lightweight WordPress theme with a built-in visual page builder. No plugins required. SEO-first semantic HTML5 structure. Works with Elementor, Beaver Builder, Divi, or any page builder. Pure HTML compatible.
Version:     1.0.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License:     GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: iwt-lightning
Tags: one-column, two-columns, right-sidebar, flexible-header, custom-colors, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready, block-patterns, wide-blocks, accessibility-ready
*/

/* ==========================================================================
   IWT Lightning Theme — Base Reset & Variables
   ========================================================================== */

:root {
  --iwt-primary:       #1a47c8;
  --iwt-primary-dark:  #0d2e8a;
  --iwt-accent:        #2563eb;
  --iwt-text:          #1a1a2e;
  --iwt-text-muted:    #6b7280;
  --iwt-bg:            #ffffff;
  --iwt-bg-alt:        #f8faff;
  --iwt-border:        #e5e7eb;
  --iwt-radius:        6px;
  --iwt-shadow:        0 2px 12px rgba(26,71,200,.10);
  --iwt-font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --iwt-font-heading:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --iwt-container:     1200px;
  --iwt-gap:           2rem;
}

*, *::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(--iwt-font);
  color: var(--iwt-text);
  background: var(--iwt-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, video, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--iwt-primary); text-decoration: none; }
a:hover { color: var(--iwt-primary-dark); text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--iwt-accent); outline-offset: 2px; border-radius: 2px; }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--iwt-font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--iwt-text);
  margin-bottom: .5em;
}
h1 { font-size: clamp(2rem,   5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem);  }
h3 { font-size: clamp(1.3rem, 3vw, 1.875rem); }
h4 { font-size: 1.375rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1.25rem; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
li { margin-bottom: .35rem; }

blockquote {
  border-left: 4px solid var(--iwt-primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--iwt-bg-alt);
  border-radius: 0 var(--iwt-radius) var(--iwt-radius) 0;
  font-style: italic;
  color: var(--iwt-text-muted);
}

code, pre {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: .9em;
}
code { background: var(--iwt-bg-alt); padding: .15em .4em; border-radius: 3px; }
pre  { background: #1a1a2e; color: #e2e8f0; padding: 1.5rem; border-radius: var(--iwt-radius); overflow-x: auto; margin-bottom: 1.25rem; }
pre code { background: none; padding: 0; }

table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
th, td { border: 1px solid var(--iwt-border); padding: .75rem 1rem; text-align: left; }
th { background: var(--iwt-bg-alt); font-weight: 600; }

/* ==========================================================================
   Layout Utilities
   ========================================================================== */

.iwt-container {
  width: 100%;
  max-width: var(--iwt-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.iwt-container--narrow { max-width: 768px; }
.iwt-container--wide   { max-width: 1440px; }

.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: #fff; border-radius: 3px; box-shadow: 0 0 2px 2px rgba(0,0,0,.6);
  clip: auto !important; clip-path: none; color: #21759b;
  display: block; font-size: .875rem; font-weight: 700;
  height: auto; left: 5px; line-height: normal;
  padding: 15px 23px 14px; text-decoration: none; top: 5px; width: auto; z-index: 100000;
}

/* ==========================================================================
   Site Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--iwt-bg);
  border-bottom: 1px solid var(--iwt-border);
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 1rem;
}

.site-branding { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.site-branding:hover { text-decoration: none; }

.site-logo { height: 44px; width: auto; }

.site-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--iwt-text);
  line-height: 1.1;
  margin: 0;
}

.site-tagline {
  font-size: .75rem;
  color: var(--iwt-text-muted);
  margin: 0;
}

/* Navigation */
.main-nav { display: flex; align-items: center; }

.main-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  align-items: center;
  gap: .25rem;
}

.main-nav ul li { position: relative; }

.main-nav ul li a {
  display: block;
  padding: .5rem .875rem;
  color: var(--iwt-text);
  font-size: .9375rem;
  font-weight: 500;
  border-radius: var(--iwt-radius);
  transition: background .15s, color .15s;
}

.main-nav ul li a:hover,
.main-nav ul li.current-menu-item > a {
  background: var(--iwt-bg-alt);
  color: var(--iwt-primary);
  text-decoration: none;
}

/* Dropdown */
.main-nav ul li ul {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #fff;
  border: 1px solid var(--iwt-border);
  border-radius: var(--iwt-radius);
  box-shadow: var(--iwt-shadow);
  min-width: 200px;
  flex-direction: column;
  display: none;
  z-index: 200;
}

.main-nav ul li:hover > ul,
.main-nav ul li:focus-within > ul { display: flex; }

.main-nav ul li ul li a { padding: .625rem 1rem; border-radius: 0; }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
  color: var(--iwt-text);
}

.nav-toggle svg { display: block; }

/* ==========================================================================
   Page Builder Blocks
   ========================================================================== */

/* Section */
.iwt-section {
  position: relative;
  width: 100%;
}

/* Row */
.iwt-row {
  display: grid;
  gap: var(--iwt-gap);
  align-items: start;
}
.iwt-row--cols-1  { grid-template-columns: 1fr; }
.iwt-row--cols-2  { grid-template-columns: repeat(2, 1fr); }
.iwt-row--cols-3  { grid-template-columns: repeat(3, 1fr); }
.iwt-row--cols-4  { grid-template-columns: repeat(4, 1fr); }
.iwt-row--1-2     { grid-template-columns: 1fr 2fr; }
.iwt-row--2-1     { grid-template-columns: 2fr 1fr; }
.iwt-row--1-3     { grid-template-columns: 1fr 3fr; }
.iwt-row--3-1     { grid-template-columns: 3fr 1fr; }
.iwt-row--1-2-1   { grid-template-columns: 1fr 2fr 1fr; }

/* Hero Block */
.iwt-hero {
  text-align: center;
  padding: 100px 1.25rem;
  background: linear-gradient(135deg, var(--iwt-primary) 0%, var(--iwt-primary-dark) 100%);
  color: #fff;
}

.iwt-hero__title {
  font-size: clamp(2.25rem, 6vw, 4rem);
  color: #fff;
  margin-bottom: 1rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.iwt-hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.375rem);
  opacity: .88;
  max-width: 600px;
  margin: 0 auto 2rem;
  color: #fff;
}

.iwt-hero__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.iwt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 2rem;
  border-radius: var(--iwt-radius);
  font-weight: 600;
  font-size: .9375rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .2s, color .2s, border-color .2s, transform .1s, box-shadow .2s;
  white-space: nowrap;
}

.iwt-btn:hover { transform: translateY(-1px); text-decoration: none; }
.iwt-btn:active { transform: translateY(0); }

.iwt-btn--primary   { background: var(--iwt-primary); color: #fff; }
.iwt-btn--primary:hover { background: var(--iwt-primary-dark); color: #fff; }

.iwt-btn--secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.iwt-btn--secondary:hover { background: rgba(255,255,255,.12); color: #fff; }

.iwt-btn--outline   { background: transparent; color: var(--iwt-primary); border-color: var(--iwt-primary); }
.iwt-btn--outline:hover { background: var(--iwt-primary); color: #fff; }

.iwt-btn--ghost     { background: transparent; color: var(--iwt-primary); }
.iwt-btn--ghost:hover { background: var(--iwt-bg-alt); }

.iwt-btn--sm { padding: .5rem 1.25rem; font-size: .875rem; }
.iwt-btn--lg { padding: 1rem 2.5rem; font-size: 1.0625rem; }

/* Card */
.iwt-card {
  background: var(--iwt-bg);
  border: 1px solid var(--iwt-border);
  border-radius: calc(var(--iwt-radius) * 2);
  overflow: hidden;
  box-shadow: var(--iwt-shadow);
  transition: box-shadow .2s, transform .2s;
}

.iwt-card:hover { box-shadow: 0 8px 30px rgba(26,71,200,.15); transform: translateY(-2px); }

.iwt-card__image img { width: 100%; height: 200px; object-fit: cover; }
.iwt-card__body { padding: 1.5rem; }
.iwt-card__title { font-size: 1.125rem; margin-bottom: .5rem; }
.iwt-card__text { color: var(--iwt-text-muted); margin: 0; }

/* Feature Block */
.iwt-feature {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.iwt-feature__icon {
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--iwt-primary), var(--iwt-accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.5rem;
}

.iwt-feature__content h3 { font-size: 1.0625rem; margin-bottom: .35rem; }
.iwt-feature__content p  { color: var(--iwt-text-muted); margin: 0; font-size: .9375rem; }

/* Divider */
.iwt-divider {
  border: none;
  border-top: 1px solid var(--iwt-border);
  margin: 2rem 0;
}

/* Spacer */
.iwt-spacer { display: block; }

/* Heading Block */
.iwt-heading { margin-bottom: 1rem; }
.iwt-heading--center { text-align: center; }
.iwt-heading--right  { text-align: right; }

.iwt-heading .iwt-heading__sub {
  display: block;
  font-size: 1rem;
  font-weight: 400;
  color: var(--iwt-text-muted);
  margin-top: .5rem;
}

/* Text Block */
.iwt-text-block { color: var(--iwt-text-muted); }
.iwt-text-block p:last-child { margin-bottom: 0; }

/* Stats */
.iwt-stat { text-align: center; }
.iwt-stat__number { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; color: var(--iwt-primary); line-height: 1; margin-bottom: .25rem; }
.iwt-stat__label  { color: var(--iwt-text-muted); font-size: .9375rem; }

/* CTA Banner */
.iwt-cta {
  background: linear-gradient(135deg, var(--iwt-primary) 0%, var(--iwt-primary-dark) 100%);
  color: #fff;
  padding: 4rem 1.25rem;
  text-align: center;
  border-radius: calc(var(--iwt-radius) * 2);
}

.iwt-cta h2 { color: #fff; margin-bottom: .75rem; }
.iwt-cta p  { color: rgba(255,255,255,.85); margin-bottom: 2rem; font-size: 1.0625rem; }

/* ==========================================================================
   Content Area
   ========================================================================== */

.site-content { padding: 3rem 0; }

.content-area { flex: 1; min-width: 0; }
.content-sidebar-wrap { display: flex; gap: 2.5rem; align-items: flex-start; }

/* Entry */
.entry-header { margin-bottom: 1.5rem; }
.entry-title   { font-size: clamp(1.75rem, 4vw, 2.75rem); }
.entry-meta    { color: var(--iwt-text-muted); font-size: .875rem; }
.entry-meta a  { color: var(--iwt-text-muted); }
.entry-meta > * + *::before { content: " · "; }

.entry-thumbnail {
  border-radius: calc(var(--iwt-radius) * 2);
  overflow: hidden;
  margin-bottom: 2rem;
}

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

.entry-content { font-size: 1.0625rem; line-height: 1.8; }
.entry-content > * + * { margin-top: 1.25rem; }
.entry-content img { border-radius: var(--iwt-radius); }

.entry-footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--iwt-border); color: var(--iwt-text-muted); font-size: .875rem; }

/* Post Loop */
.posts-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.post-card .iwt-card__body .post-meta { font-size: .8125rem; color: var(--iwt-text-muted); margin-bottom: .5rem; }
.post-card .iwt-card__body h2 { font-size: 1.125rem; margin-bottom: .5rem; }
.post-card .iwt-card__body h2 a { color: var(--iwt-text); }
.post-card .iwt-card__body h2 a:hover { color: var(--iwt-primary); text-decoration: none; }
.post-card .iwt-card__body p { font-size: .9375rem; color: var(--iwt-text-muted); margin-bottom: 1rem; }

/* Sidebar */
.sidebar { width: 280px; flex-shrink: 0; }

.widget { margin-bottom: 2rem; }
.widget-title { font-size: 1rem; font-weight: 700; border-bottom: 2px solid var(--iwt-primary); padding-bottom: .5rem; margin-bottom: 1rem; }
.widget ul { padding: 0; list-style: none; margin: 0; }
.widget ul li { padding: .35rem 0; border-bottom: 1px solid var(--iwt-border); font-size: .9375rem; }
.widget ul li:last-child { border-bottom: none; }

/* Pagination */
.pagination {
  display: flex;
  gap: .5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 3rem;
}

.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--iwt-border);
  border-radius: var(--iwt-radius);
  font-size: .875rem;
  font-weight: 600;
  color: var(--iwt-text);
  transition: background .15s, color .15s;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--iwt-primary);
  border-color: var(--iwt-primary);
  color: #fff;
  text-decoration: none;
}

/* Comments */
.comments-area { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--iwt-border); }
.comments-title { font-size: 1.375rem; margin-bottom: 1.5rem; }

.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-body { background: var(--iwt-bg-alt); padding: 1.25rem; border-radius: var(--iwt-radius); margin-bottom: 1rem; }
.comment-meta { font-size: .8125rem; color: var(--iwt-text-muted); margin-bottom: .5rem; }
.comment-author b { font-weight: 600; color: var(--iwt-text); }

/* Forms */
.comment-form label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .9375rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: .625rem .875rem;
  border: 1px solid var(--iwt-border);
  border-radius: var(--iwt-radius);
  font-family: var(--iwt-font);
  font-size: .9375rem;
  color: var(--iwt-text);
  background: var(--iwt-bg);
  transition: border-color .15s;
  margin-bottom: 1rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--iwt-primary);
  box-shadow: 0 0 0 3px rgba(26,71,200,.12);
}

.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form input[type="submit"] { /* inherits .iwt-btn .iwt-btn--primary */ }

/* ==========================================================================
   Site Footer
   ========================================================================== */

.site-footer {
  background: var(--iwt-text);
  color: rgba(255,255,255,.75);
  padding-top: 4rem;
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 3rem;
}

.footer-col h3 {
  color: #fff;
  font-size: .9375rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.footer-col p  { font-size: .9rem; line-height: 1.7; }

.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: .4rem; }
.footer-col ul li a { color: rgba(255,255,255,.65); font-size: .9rem; transition: color .15s; }
.footer-col ul li a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 1.25rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .8125rem;
  color: rgba(255,255,255,.5);
}

.footer-bottom a { color: rgba(255,255,255,.65); }
.footer-bottom a:hover { color: #fff; text-decoration: none; }

/* ==========================================================================
   Elementor / Page Builder Overrides
   ========================================================================== */

.elementor-section-wrap > .elementor-section,
.elementor-section-wrap > .e-container { max-width: 100% !important; }

body.elementor-page .site-content,
body.wp-block-template-part .site-content { padding: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .sidebar { width: 240px; }
  .iwt-row--cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --iwt-gap: 1.25rem; }

  .nav-toggle { display: block; }

  .main-nav {
    position: fixed;
    inset: 70px 0 0 0;
    background: var(--iwt-bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .25s ease;
    z-index: 99;
    border-top: 1px solid var(--iwt-border);
  }

  .main-nav.is-open { transform: translateX(0); }

  .main-nav ul { flex-direction: column; width: 100%; gap: 0; }
  .main-nav ul li a { padding: .75rem .5rem; border-radius: 0; border-bottom: 1px solid var(--iwt-border); }
  .main-nav ul li ul { position: static; box-shadow: none; border: none; border-left: 3px solid var(--iwt-primary); margin-left: 1rem; display: none; }
  .main-nav ul li.is-open > ul { display: flex; }

  .content-sidebar-wrap { flex-direction: column; }
  .sidebar { width: 100%; }

  .iwt-row--cols-2,
  .iwt-row--cols-3,
  .iwt-row--1-2,
  .iwt-row--2-1,
  .iwt-row--1-3,
  .iwt-row--3-1,
  .iwt-row--1-2-1 { grid-template-columns: 1fr; }

  .iwt-hero { padding: 60px 1.25rem; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .iwt-hero__actions { flex-direction: column; align-items: center; }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  .site-header, .site-footer, .sidebar, .nav-toggle, .comments-area { display: none; }
  body { font-size: 12pt; color: #000; }
  a { color: #000; }
  a[href]::after { content: " (" attr(href) ")"; font-size: .8em; }
  .entry-content { max-width: 100%; }
}
