/*
Theme Name: Writing Tools
Theme URI: https://wordpress.org/themes/
Author: Your Site
Description: A fast, clean theme for an online writing-tools website. Includes a paraphrasing tool, grammar checker, summarizer, translator (English ↔ Urdu), AI detector, plagiarism checker, citation generator and word counter, and creates editable SEO pages, legal pages and menus on activation. Settings: dashboard → Writing Tools.
Version: 1.2.0
Requires at least: 6.3
Tested up to: 7.2
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: wtt
Tags: one-column, custom-logo, custom-menu, editor-style, wide-blocks, translation-ready, blog, education
*/

:root {
  --wtt-ink: #1b1f3b;
  --wtt-muted: #5b6178;
  --wtt-line: #e1e5f0;
  --wtt-canvas: #f3f5fb;
  --wtt-paper: #ffffff;
  --wtt-mark: #ffe58a;
  --wtt-primary: var(--wts-primary, #4338ca);
  --wtt-accent: var(--wts-accent, #0d9488);
  --wtt-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --wtt-wide: 1180px;
  --wtt-narrow: 760px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; font-family: var(--wtt-font); font-size: 1.0625rem; line-height: 1.7; color: var(--wtt-ink); background: var(--wtt-paper); -webkit-font-smoothing: antialiased; }
img, video, svg { max-width: 100%; height: auto; }
a { color: var(--wtt-primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--wtt-primary); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.22; letter-spacing: -0.015em; font-weight: 750; margin: 2.2em 0 .6em; color: var(--wtt-ink); }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.85rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1.15em; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.wtt-skip { position: absolute; left: -999px; top: 8px; background: var(--wtt-ink); color: #fff; padding: .6rem 1rem; border-radius: 8px; z-index: 1000; }
.wtt-skip:focus { left: 8px; }

.wtt-wrap { width: min(var(--wtt-wide), calc(100% - 32px)); margin-inline: auto; }
.wtt-narrow { width: min(var(--wtt-narrow), calc(100% - 32px)); }

/* ---------- header ---------- */
.wtt-header { position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.6) blur(10px); border-bottom: 1px solid var(--wtt-line); }
.admin-bar .wtt-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .wtt-header { top: 0; position: relative; } }
.wtt-header-in { display: flex; align-items: center; gap: 1.5rem; min-height: 66px; }
.wtt-brand { flex: none; }
.wtt-brand .custom-logo { max-height: 44px; width: auto; display: block; }
.wtt-wordmark { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--wtt-ink); text-decoration: none; }
.wtt-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--wtt-primary); position: relative; overflow: hidden; flex: none; }
.wtt-mark::before { content: ""; position: absolute; left: 5px; right: 5px; top: 7px; height: 2.5px; border-radius: 2px; background: #fff; box-shadow: 0 5px 0 #fff; }
.wtt-mark::after { content: ""; position: absolute; left: 4px; right: 9px; bottom: 5px; height: 6px; border-radius: 2px; background: var(--wtt-mark); }

.wtt-nav { margin-left: auto; }
.wtt-menu, .wtt-menu ul { list-style: none; margin: 0; padding: 0; }
.wtt-menu { display: flex; align-items: center; gap: .15rem; }
.wtt-menu > li { position: relative; display: flex; align-items: center; }
.wtt-menu a { display: block; padding: .5rem .7rem; border-radius: 8px; color: var(--wtt-ink); text-decoration: none; font-size: .95rem; font-weight: 550; white-space: nowrap; }
.wtt-menu a:hover { background: var(--wtt-canvas); }
.wtt-menu .current-menu-item > a, .wtt-menu .current_page_item > a { color: var(--wtt-primary); }
.wtt-sub-toggle { border: 0; background: none; padding: .35rem; margin-left: -.45rem; cursor: pointer; color: var(--wtt-muted); border-radius: 6px; line-height: 0; }
.wtt-menu .sub-menu { position: absolute; top: 100%; right: 0; min-width: 220px; background: #fff; border: 1px solid var(--wtt-line); border-radius: 12px; box-shadow: 0 18px 40px -18px rgba(27, 31, 59, .35); padding: .35rem; display: none; }
.wtt-menu li:hover > .sub-menu, .wtt-menu li:focus-within > .sub-menu, .wtt-menu li.is-open > .sub-menu { display: block; }
.wtt-nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--wtt-line); border-radius: 10px; background: #fff; cursor: pointer; }
.wtt-bars, .wtt-bars::before, .wtt-bars::after { display: block; width: 18px; height: 2px; background: var(--wtt-ink); border-radius: 2px; position: relative; margin: auto; transition: transform .2s; }
.wtt-bars::before, .wtt-bars::after { content: ""; position: absolute; left: 0; }
.wtt-bars::before { top: -6px; }
.wtt-bars::after { top: 6px; }
.wtt-nav-open .wtt-bars { background: transparent; }
.wtt-nav-open .wtt-bars::before { transform: translateY(6px) rotate(45deg); }
.wtt-nav-open .wtt-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  .wtt-nav-toggle { display: block; }
  .wtt-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--wtt-line); padding: .5rem 16px 1rem; box-shadow: 0 20px 30px -20px rgba(27, 31, 59, .3); max-height: calc(100vh - 66px); overflow-y: auto; }
  .wtt-nav-open .wtt-nav { display: block; }
  .wtt-header-in { position: static; }
  .wtt-header { position: sticky; }
  .wtt-menu { flex-direction: column; align-items: stretch; }
  .wtt-menu > li { flex-wrap: wrap; }
  .wtt-menu > li > a { flex: 1; padding: .75rem .5rem; }
  .wtt-menu .sub-menu { position: static; display: none; width: 100%; box-shadow: none; border: 0; border-left: 2px solid var(--wtt-line); border-radius: 0; margin-left: .5rem; }
  .wtt-menu li:hover > .sub-menu { display: none; }
  .wtt-menu li.is-open > .sub-menu { display: block; }
  .wtt-sub-toggle { padding: .75rem; }
}

/* ---------- main & page titles ---------- */
.wtt-main { display: block; min-height: 60vh; padding-bottom: 3rem; }
.wtt-crumbs { font-size: .85rem; color: var(--wtt-muted); padding-top: 1.5rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.wtt-crumbs a { color: var(--wtt-muted); text-decoration: none; }
.wtt-crumbs a:hover { color: var(--wtt-primary); }
.wtt-title { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 820; margin: 1.1rem 0 1rem; }
.home .wtt-title, .wtt-has-tool .wtt-title { text-align: left; }
/* The signature: a highlighter stroke under the page title, like the tool's changed words. */
.wtt-page .wtt-title, .wtt-post .wtt-title { background-image: linear-gradient(transparent 62%, var(--wtt-mark) 62%, var(--wtt-mark) 90%, transparent 90%); display: inline; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.wtt-page .wtt-narrow:first-child, .wtt-post .wtt-narrow:first-child { margin-bottom: 1.25rem; }
.home .wtt-crumbs { display: none; }
.home .wtt-page > .wtt-narrow:first-child { padding-top: 2.5rem; }
.wtt-meta { color: var(--wtt-muted); font-size: .9rem; margin: .75rem 0 1.5rem; }
.wtt-hero-img { margin: 0 0 2rem; }
.wtt-hero-img img { border-radius: 14px; display: block; }

/* ---------- content ---------- */
.wtt-content > *:first-child { margin-top: 0; }
.wtt-content .wts-lead { font-size: 1.2rem; }
.wtt-content ul, .wtt-content ol { padding-left: 1.3rem; margin: 0 0 1.3em; }
.wtt-content li { margin-bottom: .4em; }
.wtt-content li::marker { color: var(--wtt-primary); font-weight: 700; }
.wtt-content blockquote { margin: 1.5em 0; padding: .25em 0 .25em 1.2em; border-left: 3px solid var(--wtt-primary); color: var(--wtt-muted); }
.wtt-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.wtt-content th, .wtt-content td { border-bottom: 1px solid var(--wtt-line); padding: .6rem .5rem; text-align: left; }
.wtt-content code { background: var(--wtt-canvas); padding: .1em .35em; border-radius: 5px; font-size: .9em; }
.wtt-content img { border-radius: 10px; }
.wtt-content .alignwide { width: min(var(--wtt-wide), calc(100vw - 32px)); margin-left: calc(50% - min(590px, 50vw - 16px)); }
.wtt-content .alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.wtt-content .aligncenter { margin-inline: auto; }
.wtt-content .alignleft { float: left; margin: .3em 1.5em 1em 0; }
.wtt-content .alignright { float: right; margin: .3em 0 1em 1.5em; }
.wtt-content .wp-block-button__link { background: var(--wtt-primary); color: #fff; border-radius: 999px; padding: .7em 1.4em; text-decoration: none; font-weight: 600; }
.wtt-content .wp-block-separator { border: 0; border-top: 1px solid var(--wtt-line); margin: 2.5em 0; }
.wtt-content .wts-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.wtt-content details.wts-faq summary { font-size: 1.05rem; }
.wp-caption-text, figcaption { font-size: .85rem; color: var(--wtt-muted); text-align: center; }

/* ---------- blog ---------- */
.wtt-archive-head { margin-bottom: 2rem; }
.wtt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.25rem; }
.wtt-card { border: 1px solid var(--wtt-line); border-radius: 14px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.wtt-card-img img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.wtt-card-body { padding: 1.1rem 1.2rem 1.25rem; }
.wtt-card h2 { font-size: 1.2rem; margin: 0 0 .25rem; }
.wtt-card h2 a { color: var(--wtt-ink); text-decoration: none; }
.wtt-card h2 a:hover { color: var(--wtt-primary); }
.wtt-card .wtt-meta { margin: 0 0 .5rem; font-size: .82rem; }
.wtt-card p { margin: 0; color: var(--wtt-muted); font-size: .95rem; }
.navigation.pagination { margin-top: 2rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.page-numbers { display: inline-block; padding: .4rem .8rem; border: 1px solid var(--wtt-line); border-radius: 8px; text-decoration: none; color: var(--wtt-ink); }
.page-numbers.current { background: var(--wtt-primary); border-color: var(--wtt-primary); color: #fff; }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2.5rem 0; }
.post-navigation a { display: block; border: 1px solid var(--wtt-line); border-radius: 12px; padding: .9rem 1rem; text-decoration: none; color: var(--wtt-ink); font-weight: 600; }
.post-navigation span { display: block; font-size: .8rem; color: var(--wtt-muted); font-weight: 400; }
.post-navigation .nav-next { text-align: right; }
.wtt-tags a { display: inline-block; background: var(--wtt-canvas); border-radius: 99px; padding: .15rem .7rem; font-size: .85rem; text-decoration: none; margin: 0 .3rem .3rem 0; }

/* ---------- forms, comments, search ---------- */
input[type=text], input[type=email], input[type=url], input[type=search], input[type=password], textarea, select { font: inherit; border: 1px solid var(--wtt-line); border-radius: 10px; padding: .6rem .8rem; width: 100%; background: #fff; color: var(--wtt-ink); }
.wtt-search { display: flex; gap: .5rem; margin: 1.5rem 0; }
.wtt-search button, .comment-form .submit { font: inherit; font-weight: 600; background: var(--wtt-primary); color: #fff; border: 0; border-radius: 999px; padding: .6rem 1.3rem; cursor: pointer; }
.wtt-comments { margin-top: 3rem; border-top: 1px solid var(--wtt-line); padding-top: 1rem; }
.wtt-comment-list { list-style: none; padding: 0; }
.wtt-comment-list .comment-body { border-bottom: 1px solid var(--wtt-line); padding: 1rem 0; }
.wtt-comment-list .avatar { border-radius: 50%; float: left; margin-right: .75rem; }
.wtt-404 { padding-top: 3rem; }

/* ---------- footer ---------- */
.wtt-footer { background: var(--wtt-ink); color: #c9cde0; font-size: .95rem; padding: 3.5rem 0 1.5rem; }
.wtt-footer a { color: #e8eaf4; text-decoration: none; }
.wtt-footer a:hover { color: #fff; text-decoration: underline; }
.wtt-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.wtt-footer .wtt-wordmark { color: #fff; margin-bottom: .9rem; }
.wtt-footer-about p { max-width: 36ch; margin: 0; }
.wtt-footer-h { font-size: .95rem; color: #fff; margin: 0 0 .9rem; letter-spacing: 0; }
.wtt-footer ul { list-style: none; margin: 0; padding: 0; columns: 1; }
.wtt-footer li { margin-bottom: .45rem; }
.wtt-footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 2.5rem; padding-top: 1.25rem; font-size: .85rem; color: #9aa0bb; }
.wtt-footer-base p { margin: 0; }
@media (max-width: 782px) {
  .wtt-footer-grid { grid-template-columns: 1fr 1fr; }
  .wtt-footer-about { grid-column: 1 / -1; }
  .post-navigation .nav-links { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- tools sidebar (left rail on tool pages) ---------- */
.wtt-no-mark .wtt-title { background: none !important; }
.wtt-rail { display: none; }
@media (min-width: 1100px) {
  .wtt-rail-on { --wtt-rail: 92px; }
  .wtt-shell { display: flex; align-items: flex-start; }
  .wtt-shell-main { flex: 1; min-width: 0; }
  .wtt-rail { display: block; flex: none; width: var(--wtt-rail); position: sticky; top: 66px; align-self: flex-start; height: calc(100vh - 66px); overflow-y: auto; scrollbar-width: none; border-right: 1px solid var(--wtt-line); background: #fff; padding: .9rem 0; }
  .admin-bar .wtt-rail { top: 98px; height: calc(100vh - 98px); }
  .wtt-rail::-webkit-scrollbar { display: none; }
  .wtt-rail ul { list-style: none; margin: 0; padding: 0 .5rem; display: flex; flex-direction: column; gap: .25rem; }
  .wtt-rail a { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .55rem .25rem .5rem; border-radius: 12px; text-decoration: none; color: var(--wtt-muted); font-size: .72rem; font-weight: 600; line-height: 1.2; text-align: center; }
  .wtt-rail-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--wtt-canvas); color: var(--wtt-ink); transition: background .15s, color .15s; }
  .wtt-rail a:hover { color: var(--wtt-primary); }
  .wtt-rail a:hover .wtt-rail-ico { background: color-mix(in srgb, var(--wtt-primary) 10%, #fff); color: var(--wtt-primary); }
  .wtt-rail a.is-current { color: var(--wtt-primary); }
  .wtt-rail a.is-current .wtt-rail-ico { background: var(--wtt-primary); color: #fff; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--wtt-primary) 70%, transparent); }
  .wtt-rail-sep { margin-top: .35rem; padding-top: .55rem; border-top: 1px solid var(--wtt-line); }
  /* the tool card breaks out of the text column; account for the rail */
  .wtt-rail-on .wts-app { width: min(1180px, calc(100vw - var(--wtt-rail) - 48px)) !important; margin-left: calc(50% - min(590px, (100vw - var(--wtt-rail)) / 2 - 24px)) !important; margin-right: calc(50% - min(590px, (100vw - var(--wtt-rail)) / 2 - 24px)) !important; }
  .wtt-rail-on .wtt-content .alignwide { width: min(1180px, calc(100vw - var(--wtt-rail) - 48px)); margin-left: calc(50% - min(590px, (100vw - var(--wtt-rail)) / 2 - 24px)); }
}
.wtt-blog-intro { max-width: 70ch; margin-top: .5rem; }
.wtt-blog-intro > :last-child { margin-bottom: 0; }
