/*
Theme Name: Technology Wolf
Theme URI: https://technologywolf.net
Author: Technology Wolf
Author URI: https://technologywolf.net
Description: A fast, dark, modern block theme for tech news, AI tools, gadget reviews and how-to guides. Built for readability, speed and SEO.
Version: 1.1.1
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: technology-wolf
Tags: blog, news, one-column, two-columns, grid-layout, custom-colors, full-site-editing, block-patterns, wide-blocks, dark
*/

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

a { text-underline-offset: 0.18em; }
.wp-block-post-title a,
.wp-block-site-title a,
.wp-block-navigation a,
.tw-card a { text-decoration: none; }
.wp-block-post-title a:hover,
.tw-card h3 a:hover { color: var(--wp--preset--color--primary); }

/* Navigation */
.wp-block-navigation .wp-block-navigation-item a { padding: 0.35rem 0.1rem; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.wp-block-navigation .wp-block-navigation-item a:hover { color: var(--wp--preset--color--primary); border-bottom-color: var(--wp--preset--color--primary); }

/* Cards */
.tw-card { transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.tw-card:hover { transform: translateY(-3px); border-color: var(--wp--preset--color--primary) !important; box-shadow: 0 10px 30px rgba(34, 211, 238, .08); }
.tw-post-card .wp-block-post-featured-image img { border-radius: 12px; transition: transform .25s ease; }
.tw-post-card:hover .wp-block-post-featured-image img { transform: scale(1.02); }
.tw-post-card .wp-block-post-featured-image { overflow: hidden; border-radius: 12px; }

/* Category labels */
.wp-block-post-terms a { text-decoration: none; text-transform: uppercase; letter-spacing: .08em; }

/* Forms */
input[type="text"], input[type="email"], input[type="search"], input[type="url"], textarea, select {
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--contrast);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 8px;
  padding: .7rem .9rem;
  width: 100%;
  max-width: 100%;
  font: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--wp--preset--color--primary); outline-offset: 1px; }
input[type="submit"], .wpcf7-submit {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--base);
  border: 0; border-radius: 8px; padding: .75rem 1.4rem; font-weight: 700; cursor: pointer; width: auto;
}
input[type="submit"]:hover, .wpcf7-submit:hover { background: var(--wp--preset--color--tertiary); }

/* Content readability */
.entry-content > * + *, .wp-block-post-content > * + * { margin-block-start: 1.25em; }
.wp-block-post-content a { text-decoration: underline; }
.wp-block-post-content blockquote { border-left: 3px solid var(--wp--preset--color--primary); padding-left: 1.2rem; color: var(--wp--preset--color--muted); }
.wp-block-post-content code { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--border); border-radius: 6px; padding: .1em .4em; font-size: .9em; }
.wp-block-post-content pre { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--border); border-radius: 10px; padding: 1rem; overflow-x: auto; }
.wp-block-table table, .wp-block-table td, .wp-block-table th { border-color: var(--wp--preset--color--border); }

/* ---------- Mega dropdown (Tech News) ---------- */
.wp-block-navigation .tw-mega > .wp-block-navigation__submenu-container {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5rem;
  min-width: 440px;
  padding: 1rem 1.2rem;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 12px;
  background: var(--wp--preset--color--surface);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
.wp-block-navigation .tw-mega .wp-block-navigation-item a { padding: .45rem .2rem; border-bottom: 0; white-space: nowrap; }
.wp-block-navigation .tw-mega .wp-block-navigation-item a:hover { color: var(--wp--preset--color--primary); }
.wp-block-navigation__responsive-container.is-menu-open .tw-mega > .wp-block-navigation__submenu-container {
  display: flex !important; flex-direction: column; min-width: 0; border: 0; box-shadow: none; padding: 0 0 0 1rem;
}

/* ---------- Magazine category layout ---------- */
.tw-mag .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}
.tw-mag .wp-block-post-template > li { margin: 0; min-width: 0; }
.tw-mag .wp-block-post-template > li:first-child { grid-column: 1 / 3; grid-row: 1 / 3; }
body.paged .tw-mag .wp-block-post-template > li:first-child { grid-column: auto; grid-row: auto; }

.tw-ov {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  height: 100%;
  min-height: 220px;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #16213E 0%, #0E3A4A 100%);
  border: 1px solid var(--wp--preset--color--border);
  transition: transform .18s ease, border-color .18s ease;
}
.tw-ov:hover { transform: translateY(-3px); border-color: var(--wp--preset--color--primary); }
.tw-mag li:nth-child(5n+2) .tw-ov { background: linear-gradient(135deg, #2a1a5e 0%, #16213E 100%); }
.tw-mag li:nth-child(5n+3) .tw-ov { background: linear-gradient(135deg, #0d3b2e 0%, #16213E 100%); }
.tw-mag li:nth-child(5n+4) .tw-ov { background: linear-gradient(135deg, #3b1d3d 0%, #16213E 100%); }
.tw-ov .wp-block-post-featured-image { position: absolute; inset: 0; margin: 0; }
.tw-ov .wp-block-post-featured-image a, .tw-ov .wp-block-post-featured-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tw-ov-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 3rem 1.1rem 1.1rem;
  background: linear-gradient(to top, rgba(10, 15, 30, .96) 0%, rgba(10, 15, 30, .72) 55%, rgba(10, 15, 30, 0) 100%);
  display: flex; flex-direction: column; gap: .3rem;
}
.tw-ov-body > * { margin: 0 !important; }
.tw-ov-body .wp-block-post-terms a {
  display: inline-block; background: var(--wp--preset--color--primary); color: var(--wp--preset--color--base);
  padding: .1rem .5rem; border-radius: 4px; font-weight: 700;
}
.tw-ov-body .wp-block-post-title { font-size: 1.02rem !important; line-height: 1.25; }
.tw-ov-body .wp-block-post-title a { color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.tw-ov-body .wp-block-post-date { color: var(--wp--preset--color--muted); font-size: .8rem !important; }
.tw-mag li:first-child .tw-ov { aspect-ratio: auto; min-height: 460px; }
.tw-mag li:first-child .tw-ov-body { padding: 5rem 1.6rem 1.6rem; }
.tw-mag li:first-child .wp-block-post-title { font-size: clamp(1.4rem, 2.6vw, 2.1rem) !important; }
body.paged .tw-mag li:first-child .tw-ov { aspect-ratio: 4 / 3; min-height: 220px; }
body.paged .tw-mag li:first-child .tw-ov-body { padding: 3rem 1.1rem 1.1rem; }
body.paged .tw-mag li:first-child .wp-block-post-title { font-size: 1.02rem !important; }

@media (max-width: 900px) {
  .tw-mag .wp-block-post-template { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tw-mag .wp-block-post-template > li:first-child { grid-column: 1 / -1; grid-row: auto; }
  .tw-mag li:first-child .tw-ov { min-height: 340px; }
}
@media (max-width: 560px) {
  .tw-mag .wp-block-post-template { grid-template-columns: 1fr; }
}
@media (max-width: 781px) {
  .tw-hero h1 { font-size: 2.3rem !important; }
}
