/*
Theme Name: TechSkiller
Theme URI: https://techskiller.com/
Author: TechSkiller
Description: Fast, block-based theme for the TechSkiller training institute — VLSI, Embedded Systems, DevOps and Full Stack. No page builder, no webfont requests, minimal CSS.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: techskiller
Tags: full-site-editing, blog, education, block-patterns, accessibility-ready
*/

/* theme.json carries the design system. This file holds only what blocks cannot express. */

:root {
  --ts-radius-sm: 6px;
  --ts-radius-md: 10px;
  --ts-radius-lg: 16px;
  --ts-ring: 0 0 0 2px var(--wp--preset--color--accent);
}

/* ---------- Base niceties ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, video { height: auto; max-width: 100%; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 2px;
  border-radius: var(--ts-radius-sm);
}

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; inset-inline-start: 1rem; inset-block-start: 1rem; z-index: 999;
  width: auto; height: auto; clip: auto; margin: 0;
  background: var(--wp--preset--color--ink); color: #fff;
  padding: .7rem 1rem; border-radius: var(--ts-radius-sm); text-decoration: none;
}

/* ---------- Header ---------- */
.ts-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--wp--preset--color--base) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--wp--preset--color--border);
}
@supports not (backdrop-filter: blur(1px)) {
  .ts-header { background: var(--wp--preset--color--base); }
}
.ts-header .wp-block-navigation__responsive-container-open,
.ts-header .wp-block-navigation__responsive-container-close { color: var(--wp--preset--color--ink); }
.ts-header .wp-block-navigation .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--accent); }
.ts-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
  color: var(--wp--preset--color--accent);
  text-underline-offset: 6px;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* ---------- Eyebrow / label ---------- */
/* post-terms renders links inside the eyebrow; keep them flat */
.ts-eyebrow a { text-decoration: none; color: inherit; }
.ts-eyebrow a:hover { text-decoration: underline; text-underline-offset: 3px; }

.ts-eyebrow {
  font-family: var(--wp--preset--font-family--mono);
  font-size: .75rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--wp--preset--color--accent); font-weight: 600;
}

/* ---------- Cards ---------- */
.ts-card {
  background: var(--wp--preset--color--base);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--ts-radius-lg);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  height: 100%;
}
.ts-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--wp--preset--color--accent) 45%, var(--wp--preset--color--border));
  box-shadow: var(--wp--preset--shadow--lift);
}
.ts-card :where(h2, h3, h4) a { text-decoration: none; color: inherit; }
.ts-card :where(h2, h3, h4) a:hover { color: var(--wp--preset--color--accent); }

/* Make the whole card clickable where a cover link exists */
.ts-card--link { position: relative; }
.ts-card--link a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }

/* ---------- Badge / pill ---------- */
.ts-badge {
  display: inline-block;
  background: var(--wp--preset--color--accent-soft);
  color: #7a3c06;
  border-radius: 999px;
  padding: .28em .8em;
  font-size: .78rem; font-weight: 600; letter-spacing: .01em;
}

/* ---------- Spec list (duration / mode / batch) ---------- */
.ts-specs { display: grid; gap: .55rem; padding: 0; list-style: none; }
.ts-specs li { display: flex; gap: .6rem; font-size: .9375rem; color: var(--wp--preset--color--ink-soft); }
.ts-specs li strong { color: var(--wp--preset--color--ink); font-weight: 600; min-width: 7.5rem; }

/* ---------- Checklist ---------- */
.ts-check { list-style: none; padding: 0; display: grid; gap: .6rem; }
.ts-check li { position: relative; padding-inline-start: 1.6rem; }
.ts-check li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .52em;
  width: .62rem; height: .62rem; border-radius: 2px;
  background: var(--wp--preset--color--accent);
}

/* ---------- Dark sections ---------- */
.ts-dark { background: var(--wp--preset--color--ink); color: #e7ecf3; }
.ts-dark :where(h1,h2,h3,h4,p,li) { color: inherit; }
.ts-dark .ts-eyebrow { color: #f0a85e; }
.ts-dark a:not(.wp-block-button__link) { color: #cfd8e3; }
.ts-dark a:not(.wp-block-button__link):hover { color: #f0a85e; }
.ts-dark .wp-block-site-title a { color: #ffffff; }
.ts-dark .ts-card { background: #16233a; border-color: #24354f; }

/* ---------- Blog prose ---------- */
.ts-prose { max-width: 720px; }
.ts-prose-page :where(h2) { margin-top: 2.2em; }
.ts-prose-page :where(h3) { margin-top: 1.8em; }
.ts-prose :where(h2) { margin-top: 2.4em; }
.ts-prose :where(h3) { margin-top: 1.9em; }
.ts-prose :where(p, ul, ol) { line-height: 1.75; }
.ts-prose :where(ul, ol) { padding-inline-start: 1.25rem; }
.ts-prose :where(li) { margin-block: .4em; }
.ts-prose :where(img) { border-radius: var(--ts-radius-md); }

/* ---------- Post meta ---------- */
.ts-meta { font-size: .875rem; color: var(--wp--preset--color--ink-soft); }
.ts-meta a { color: inherit; text-decoration: none; }
.ts-meta a:hover { color: var(--wp--preset--color--accent); text-decoration: underline; }

/* ---------- Featured image framing ---------- */
.ts-thumb img { border-radius: var(--ts-radius-md); }

/* ---------- Table readability ---------- */
.wp-block-table table { border-collapse: collapse; width: 100%; }
.wp-block-table :where(th, td) {
  border: 1px solid var(--wp--preset--color--border);
  padding: .7rem .85rem; text-align: start; vertical-align: top;
}
.wp-block-table thead th { background: var(--wp--preset--color--surface); font-weight: 650; }

/* ---------- Details / FAQ ---------- */
.wp-block-details {
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--ts-radius-md);
  padding: 1rem 1.15rem;
  background: var(--wp--preset--color--base);
}
.wp-block-details + .wp-block-details { margin-top: .7rem; }
.wp-block-details summary { cursor: pointer; font-weight: 600; }
.wp-block-details[open] summary { margin-bottom: .6rem; }

/* ---------- Pagination ---------- */
.wp-block-query-pagination { gap: .4rem; }
.wp-block-query-pagination :where(a, span) {
  text-decoration: none; padding: .45rem .8rem;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--ts-radius-sm);
}
.wp-block-query-pagination .page-numbers.current {
  background: var(--wp--preset--color--primary); color: #fff; border-color: var(--wp--preset--color--primary);
}

/* ---------- Footer ---------- */
.ts-footer a { text-decoration: none; }
.ts-footer a:hover { text-decoration: underline; }

/* ---------- Enquiry form ---------- */
.ts-form-wrap { max-width: 640px; }
.ts-form { display: grid; gap: 1rem; }
.ts-field { margin: 0; display: grid; gap: .35rem; }
.ts-field-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 540px) { .ts-field-row { grid-template-columns: 1fr; } }
.ts-field label { font-size: .9rem; font-weight: 600; color: var(--wp--preset--color--ink); }
.ts-field :where(input, select, textarea) {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--wp--preset--color--ink);
  background: var(--wp--preset--color--base);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--ts-radius-md);
  padding: .68rem .8rem;
}
.ts-field :where(input, select, textarea):focus {
  border-color: var(--wp--preset--color--primary);
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 1px;
}
.ts-field textarea { resize: vertical; min-height: 7rem; }
.ts-field button {
  justify-self: start;
  cursor: pointer;
  border: 0;
  font-weight: 600;
}
.ts-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ts-form-note { margin: 0; font-size: .82rem; color: var(--wp--preset--color--ink-soft); }
.ts-notice {
  border-radius: var(--ts-radius-md);
  padding: .85rem 1rem;
  margin: 0 0 1rem;
  font-size: .95rem;
  border: 1px solid;
}
.ts-notice--ok  { background: #ecfdf5; border-color: #a7d7c0; color: #11503a; }
.ts-notice--err { background: #fef2f2; border-color: #e7b4b4; color: #7a2121; }

/* Dark sections host the form on the contact page */
.ts-dark .ts-field label { color: #e7ecf3; }
.ts-dark .ts-form-note { color: #aab7c9; }

/* ---------- Narrow viewports ---------- */
/* Wide content must scroll inside its own box, never the page body. */
.wp-block-code,
.wp-block-preformatted { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wp-block-table { overflow-x: auto; }
.ts-prose :where(p, li, h1, h2, h3, h4) { overflow-wrap: break-word; }

@media (max-width: 781px) {
  .ts-header .wp-block-navigation__responsive-container-open { margin-inline-start: auto; }
  .ts-specs li { flex-direction: column; gap: .1rem; }
  .ts-specs li strong { min-width: 0; }
}

@media (max-width: 600px) {
  .ts-card { border-radius: 12px; }
  .wp-block-query-pagination :where(a, span) { padding: .4rem .65rem; }
}

/* ---------- LMS floating badge ---------- */
.ts-lms {
  position: fixed;
  bottom: 1.25rem;
  z-index: 200;
  max-width: min(24.5rem, calc(100vw - 2rem));
  display: flex;
  align-items: stretch;
  background: var(--wp--preset--color--ink);
  color: #f2f6fb;
  border-radius: 14px;
  box-shadow: 0 10px 40px -8px rgba(12, 22, 35, .45);
  animation: ts-lms-in .32s cubic-bezier(.2, .8, .3, 1) both;
}
.ts-lms--right { right: 1.25rem; }
.ts-lms--left  { left: 1.25rem; }
.ts-lms[hidden] { display: none; }

@keyframes ts-lms-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ts-lms { animation: none; }
}

.ts-lms__link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 2.3rem .9rem 1rem;
  color: inherit;
  text-decoration: none;
  border-radius: inherit;
}
.ts-lms__link:hover { color: inherit; }
.ts-lms__link:hover .ts-lms__go { transform: translateX(3px); }

.ts-lms__spark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--wp--preset--color--accent);
  color: #fff;
}

.ts-lms__text { display: grid; gap: .12rem; line-height: 1.35; }
.ts-lms__text strong { font-size: .9375rem; font-weight: 650; }
.ts-lms__text span   { font-size: .8125rem; color: #aebccd; }

.ts-lms__go {
  position: absolute;
  right: .95rem;
  top: 50%;
  translate: 0 -50%;
  color: var(--wp--preset--color--accent);
  font-size: 1.05rem;
  transition: transform .18s ease;
}
.ts-lms__link { position: relative; }

.ts-lms__close {
  position: absolute;
  top: -.5rem;
  inset-inline-end: -.5rem;
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  border: 1px solid #2d3f58;
  border-radius: 50%;
  background: #1b2941;
  color: #c3cfdd;
  cursor: pointer;
  padding: 0;
}
.ts-lms__close:hover { background: #24354f; color: #fff; }

@media (max-width: 560px) {
  .ts-lms { left: .75rem; right: .75rem; bottom: .75rem; max-width: none; }
  .ts-lms__text span { display: none; }
}

@media print { .ts-lms { display: none; } }
