/*
Theme Name: ToolRava
Theme URI: https://toolrava.com
Author: ToolRava
Author URI: https://toolrava.com
Description: A clean, lightweight, fast custom theme for ToolRava.com — a free online tools and how-to guides website. Mobile-first, no page-builder bloat, built for real browser-based tools (image compression, PDF conversion, calculators, text tools) plus a standard WordPress blog for guides.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: toolrava
*/

/* This stylesheet is enqueued as the theme's main stylesheet via functions.php (get_stylesheet_uri()). */

/* ToolRava — main stylesheet. Mobile-first, no framework, no heavy assets. */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f6f8fb;
  --color-text: #1c2430;
  --color-text-muted: #5b6474;
  --color-border: #e3e7ee;
  --color-primary: #2660f0;
  --color-primary-dark: #1c49bf;
  --color-primary-light: #eaf0fe;
  --color-accent: #12b886;
  --color-danger: #e0393e;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(20, 29, 45, 0.06), 0 1px 1px rgba(20, 29, 45, 0.04);
  --shadow-md: 0 6px 20px rgba(20, 29, 45, 0.08);
  --container-width: 1140px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { padding: 0; margin: 0; list-style: none; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 1.4rem + 1.4vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 1.15rem + 0.7vw, 1.75rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; color: var(--color-text-muted); }
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 20px; }
main { display: block; }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--color-primary);
  color: #fff; padding: 10px 16px; z-index: 200; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid #2660f055; outline-offset: 2px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: .95rem; padding: 12px 22px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary { background: #fff; color: var(--color-primary); border-color: var(--color-border); }
.btn-secondary:hover { background: var(--color-bg-alt); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* Header */
.site-header { border-bottom: 1px solid var(--color-border); background: #fff; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--color-text); }
.logo:hover { text-decoration: none; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; background: var(--color-primary); color: #fff;
  font-size: .78rem; letter-spacing: .02em;
}
.primary-nav ul { display: flex; gap: 26px; }
.primary-nav a { color: var(--color-text); font-weight: 500; font-size: .95rem; }
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; background: none; border: 1px solid var(--color-border); border-radius: 8px; cursor: pointer;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--color-text); margin: 0 auto; }

@media (max-width: 800px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute; top: 64px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--color-border);
    max-height: 0; overflow: hidden; transition: max-height .2s ease;
  }
  .primary-nav.open { max-height: 400px; }
  .primary-nav ul { flex-direction: column; gap: 0; padding: 8px 20px 16px; }
  .primary-nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--color-border); }
}

/* Hero */
.hero { background: var(--color-bg-alt); padding: 56px 0 48px; text-align: center; }
.hero h1 { max-width: 720px; margin-left: auto; margin-right: auto; }
.hero .tagline { font-size: 1.05rem; max-width: 560px; margin: 0 auto 28px; }

/* Search */
.search-form { max-width: 560px; margin: 0 auto; position: relative; }
.search-form input[type="search"] {
  width: 100%; padding: 14px 18px; font-size: 1rem; border: 1px solid var(--color-border);
  border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm);
}
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff;
  border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-md);
  text-align: left; overflow: hidden; z-index: 20; display: none;
}
.search-results.open { display: block; }
.search-results a { display: block; padding: 12px 16px; color: var(--color-text); border-bottom: 1px solid var(--color-border); }
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--color-bg-alt); text-decoration: none; }
.search-results .no-results { padding: 12px 16px; color: var(--color-text-muted); }

/* Sections */
.section { padding: 48px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; gap: 12px; flex-wrap: wrap; }
.section-head p.section-sub { margin: 0; }
.section-alt { background: var(--color-bg-alt); }

/* Grids */
.grid { display: grid; gap: 20px; }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) { .grid-cols-3, .grid-cols-4, .grid-cols-6 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-cols-3, .grid-cols-4, .grid-cols-6 { grid-template-columns: 1fr; } }

/* Cards */
.card {
  display: block; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 22px; transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { box-shadow: var(--shadow-md); text-decoration: none; transform: translateY(-2px); }
.card h3 { margin-bottom: 6px; color: var(--color-text); }
.card p { margin-bottom: 0; font-size: .92rem; }
.card .tool-icon {
  width: 42px; height: 42px; border-radius: 9px; background: var(--color-primary-light);
  color: var(--color-primary); display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
  font-weight: 700;
}
.category-card { text-align: left; }
.category-card .cat-icon {
  width: 46px; height: 46px; border-radius: 10px; background: var(--color-bg-alt);
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 1.3rem;
}

/* Badges */
.badge {
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 999px; background: var(--color-primary-light); color: var(--color-primary-dark);
}

/* Breadcrumbs */
.breadcrumbs { font-size: .85rem; color: var(--color-text-muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs span[aria-current] { color: var(--color-text); }

/* Tool page layout */
.tool-hero { padding: 36px 0 8px; }
.tool-hero .badge { margin-bottom: 12px; }
.tool-app {
  background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 26px; margin: 28px 0;
}
.tool-app h2 { margin-bottom: 4px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.field input[type="text"],
.field input[type="number"],
.field textarea,
.field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  font-size: .97rem; font-family: inherit; background: #fff;
}
.field textarea { resize: vertical; min-height: 160px; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row .field { flex: 1 1 160px; }
.help-text { font-size: .82rem; color: var(--color-text-muted); margin-top: 4px; }

.dropzone {
  border: 2px dashed var(--color-border); border-radius: var(--radius); padding: 34px 18px; text-align: center;
  background: #fff; cursor: pointer;
}
.dropzone.dragover { border-color: var(--color-primary); background: var(--color-primary-light); }
.dropzone p { margin: 6px 0 0; }
.dropzone strong { color: var(--color-primary); }

.result-box { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 18px; margin-top: 18px; }
.result-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--color-border); font-size: .93rem; }
.result-row:last-child { border-bottom: none; }
.result-row strong { color: var(--color-text); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
@media (max-width: 640px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-box { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.stat-box .stat-value { font-size: 1.4rem; font-weight: 800; color: var(--color-primary); }
.stat-box .stat-label { font-size: .78rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .03em; }

.file-list { margin-top: 14px; }
.file-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-sm); margin-bottom: 8px; font-size: .88rem;
}
.file-list .file-remove { color: var(--color-danger); background: none; border: none; cursor: pointer; font-weight: 700; }

.progress { height: 8px; border-radius: 999px; background: var(--color-border); overflow: hidden; margin-top: 10px; display: none; }
.progress.active { display: block; }
.progress-bar { height: 100%; width: 0%; background: var(--color-primary); transition: width .15s ease; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .9rem; margin-top: 14px; display: none; }
.alert.active { display: block; }
.alert-error { background: #fdeceb; color: #a3221f; border: 1px solid #f6c3c1; }
.alert-success { background: #e9f9f2; color: #0b7a54; border: 1px solid #b9ecd7; }

/* Content sections on tool/guide pages */
.content-block { padding: 8px 0 36px; }
.content-block h2 { margin-top: 2.2em; }
.content-block h2:first-child { margin-top: 0; }

.faq-item { border-bottom: 1px solid var(--color-border); padding: 16px 0; }
.faq-item:first-child { padding-top: 0; }
.faq-item h3 { margin-bottom: 6px; }
.faq-item p { margin-bottom: 0; }

/* About / trust page */
.prose p, .prose li { color: var(--color-text-muted); }
.prose ul { list-style: disc; padding-left: 1.3em; margin-bottom: 1em; }
.prose li { margin-bottom: .4em; }

/* Footer */
.site-footer { background: #101623; color: #c6ccd8; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; padding: 48px 0 32px; }
@media (max-width: 800px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-inner { grid-template-columns: 1fr; } }
.site-footer .logo { color: #fff; }
.site-footer .logo-mark { background: #2b3a5c; }
.site-footer p { color: #9aa3b5; font-size: .88rem; }
.footer-col h2 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 14px; }
.footer-col ul li { margin-bottom: 9px; }
.footer-col a { color: #b7bfd0; font-size: .9rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #232c3f; padding: 16px 0; }
.footer-bottom p { color: #7c8496; font-size: .82rem; margin: 0; }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- */
/* WordPress-specific: core blocks, post content, pagination, forms  */
/* ---------------------------------------------------------------- */

.entry-content { max-width: 760px; }
.entry-content p, .entry-content ul, .entry-content ol { color: var(--color-text-muted); }
.entry-content h2, .entry-content h3, .entry-content h4 { color: var(--color-text); }
.entry-content img { border-radius: var(--radius-sm); }
.entry-content a { text-decoration: underline; }
.entry-content blockquote {
  margin: 1.4em 0; padding: 4px 20px; border-left: 3px solid var(--color-primary);
  color: var(--color-text); font-style: italic;
}
.entry-content .wp-block-code, .entry-content pre {
  background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 14px 16px; overflow-x: auto; font-size: .88rem;
}
.entry-content figcaption { font-size: .82rem; color: var(--color-text-muted); text-align: center; margin-top: 6px; }
.alignwide { max-width: 1000px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100%; max-width: none; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }

.post-meta { font-size: .85rem; color: var(--color-text-muted); margin-bottom: 18px; }
.post-header { margin-bottom: 22px; }
.post-thumbnail { margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; }

.pagination { display: flex; gap: 8px; justify-content: center; margin: 36px 0 8px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 8px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: .9rem;
}
.pagination .current { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.pagination a:hover { background: var(--color-bg-alt); text-decoration: none; }

.guide-card { display: block; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.guide-card:hover { box-shadow: var(--shadow-md); text-decoration: none; transform: translateY(-2px); }
.guide-card img { aspect-ratio: 16/9; object-fit: cover; }
.guide-card .guide-card-body { padding: 16px 18px; }
.guide-card h3 { margin-bottom: 6px; color: var(--color-text); }
.guide-card p { font-size: .88rem; margin-bottom: 0; }
.guide-card .post-meta { margin: 0 0 6px; }

.no-results { padding: 40px 0; text-align: center; }

/* Native WP search form, styled to match the hero search */
.search-form-native { display: flex; gap: 8px; max-width: 560px; margin: 0 auto; }
.search-form-native input[type="search"] {
  flex: 1; padding: 14px 18px; font-size: 1rem; border: 1px solid var(--color-border);
  border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm);
}
.search-form-native button { border-radius: 999px; }

/* Ad slot placeholders — safe no-op containers until ad code is added via Customizer */
.ad-slot { margin: 28px 0; text-align: center; }
.ad-slot:empty { display: none; }

/* Screen-reader text (WordPress core convention, used by some plugins) */
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap; border: 0;
}
