/*
Theme Name: Techopedeia
Theme URI: https://techopedeia.com/
Author: Techopedeia
Author URI: https://techopedeia.com/
Description: A fast, responsive tech-news theme with a three-column story grid. The homepage hero and every story card are editable from the WordPress dashboard. No JavaScript required.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: techopedeia
Tags: news, blog, grid-layout, three-columns, custom-logo, custom-menu, featured-images, translation-ready, accessibility-ready
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
  --page-bg: #f6f7f9;
  --surface: #ffffff;
  --text: #17191d;
  --muted: #717680;
  --line: #e6e8ec;
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --accent-soft: #eaf1ff;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(18, 22, 30, 0.06);
}

/* ==========================================================================
   2. Base
   ========================================================================== */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

.container { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }

/* Accessible focus ring for keyboard users only (no JavaScript needed). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==========================================================================
   3. Accessibility helpers
   ========================================================================== */

.screen-reader-text {
  border: 0;
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  word-wrap: normal !important;
}

.skip-link {
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  left: 16px;
  padding: 12px 18px;
  position: absolute;
  top: -100px;
  z-index: 100000;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: top .2s ease;
}

.skip-link:focus {
  top: 16px;
  clip-path: none;
  height: auto;
  width: auto;
  overflow: visible;
}

/* ==========================================================================
   4. Header
   ========================================================================== */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 12px 0;
}

.brand {
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 20px;
}

.custom-logo-link { display: block; }
.custom-logo { width: auto; max-height: 44px; }

.primary-nav .menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  font-weight: 600;
}

.primary-nav a { text-decoration: none; }
.primary-nav a:hover { text-decoration: underline; text-underline-offset: 3px; }

.primary-nav .current-menu-item > a { color: var(--accent); }

.header-date {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

/* ==========================================================================
   5. Page shell + hero
   ========================================================================== */

.page-content { padding: 64px 0 80px; }

.page-heading { max-width: 760px; margin-bottom: 38px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.page-heading h1,
.single-header h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.single-header h1 { font-size: clamp(32px, 4.2vw, 52px); }

.intro {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

/* ==========================================================================
   6. Story grid
   ========================================================================== */

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.news-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.news-card:hover {
  transform: translateY(-3px);
  border-color: #d9dce2;
  box-shadow: 0 13px 34px rgba(18, 22, 30, 0.09);
}

.image-link {
  display: block;
  overflow: hidden;
  background: #eceef1;
  aspect-ratio: 16 / 10;
}

.image-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.news-card:hover .image-link img { transform: scale(1.025); }

/* Shown when a post has no featured image, so the grid never collapses. */
.image-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #eef1f6 0%, #dde3ec 100%);
}

.card-body {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.card-body h2 {
  margin: 0 0 13px;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.card-body h2 a { text-decoration: none; }
.card-body h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }

.card-body time {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.card-body p {
  margin: 0 0 24px;
  color: #555b65;
  font-size: 15px;
  line-height: 1.62;
}

.cta {
  margin-top: auto;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .24);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .01em;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.cta .cta-arrow {
  font-size: 20px;
  line-height: 0;
  transform: translateY(-1px);
  transition: transform .18s ease;
}

.cta:hover,
.cta:focus-visible {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, .34);
  filter: saturate(1.12) brightness(1.04);
}

.cta:hover .cta-arrow,
.cta:focus-visible .cta-arrow {
  transform: translate(3px, -1px);
}

/* ==========================================================================
   7. Single post + pages
   ========================================================================== */

.single-header { max-width: 820px; margin-bottom: 30px; }

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.entry-meta .sep { color: var(--line); }

.entry-meta a { text-decoration: none; color: var(--accent); }
.entry-meta a:hover { text-decoration: underline; }

.post-thumbnail {
  display: block;
  margin: 0 0 34px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.entry-content {
  max-width: 820px;
  font-size: 17px;
  line-height: 1.75;
  color: #2b3038;
}

.entry-content > * { margin-top: 0; margin-bottom: 1.35em; }

.entry-content h2 { font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; margin-top: 1.6em; }
.entry-content h3 { font-size: 24px; line-height: 1.25; letter-spacing: -0.015em; margin-top: 1.5em; }
.entry-content h4 { font-size: 20px; line-height: 1.3; margin-top: 1.4em; }

.entry-content a { color: var(--accent); text-underline-offset: 3px; }
.entry-content ul,
.entry-content ol { padding-left: 1.35em; }
.entry-content li { margin-bottom: .5em; }

.entry-content blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-left: 4px solid var(--accent);
  color: #454b55;
  font-style: italic;
}

.entry-content code,
.entry-content pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  background: #f1f3f7;
  border-radius: 8px;
}

.entry-content code { padding: 2px 6px; }
.entry-content pre { padding: 18px; overflow-x: auto; }
.entry-content pre code { padding: 0; background: none; }

.entry-content img,
.entry-content .wp-block-image img { border-radius: 10px; }

.entry-content table { width: 100%; border-collapse: collapse; font-size: 15px; }
.entry-content th,
.entry-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.entry-content th { background: #f1f3f7; }

.entry-content figcaption,
.wp-caption-text,
.gallery-caption {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 8px;
  text-align: left;
}

.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { margin-left: auto; margin-right: auto; }

.sticky .card-body h2::before {
  content: "Featured";
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.page-links { margin-top: 30px; font-weight: 700; }

.post-navigation {
  max-width: 820px;
  margin-top: 46px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
  font-weight: 700;
}

.post-navigation a { text-decoration: none; color: var(--accent); max-width: 46%; }
.post-navigation a:hover { text-decoration: underline; }

/* ==========================================================================
   8. Pagination, search, 404, archives
   ========================================================================== */

.pagination { margin-top: 44px; }

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
}

.pagination .page-numbers.current {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
}

.pagination .page-numbers.dots { border-color: transparent; background: none; }

.archive-description {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 520px;
  margin-top: 26px;
}

.search-form label { flex: 1 1 260px; margin: 0; }

.search-form .search-field {
  width: 100%;
  padding: 13px 16px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.search-form .search-submit {
  flex: 0 0 auto;
  padding: 13px 22px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}

.no-results {
  max-width: 620px;
  color: #555b65;
  font-size: 16px;
  line-height: 1.7;
}

.no-results h2 { font-size: 24px; letter-spacing: -0.02em; margin-bottom: 10px; }

/* ==========================================================================
   9. Footer
   ========================================================================== */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.footer-inner {
  min-height: 126px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.footer-inner p { margin: 0; }
.footer-inner strong { color: var(--text); }

/* ==========================================================================
   10. WordPress core alignment + responsive
   ========================================================================== */

@media (max-width: 980px) {
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-content { padding-top: 52px; }
}

@media (max-width: 680px) {
  .container { width: min(100% - 30px, 620px); }
  .header-inner { min-height: 62px; gap: 10px 18px; }
  .brand { font-size: 18px; }
  .header-date { font-size: 12px; }
  .primary-nav .menu { gap: 14px; font-size: 14px; }
  .page-content { padding: 38px 0 52px; }
  .page-heading { margin-bottom: 27px; }
  .page-heading h1 { font-size: clamp(36px, 12vw, 48px); }
  .single-header h1 { font-size: clamp(29px, 9vw, 38px); }
  .intro { margin-top: 14px; font-size: 15px; line-height: 1.55; }
  .news-grid { grid-template-columns: 1fr; gap: 18px; }
  .news-card { border-radius: 12px; }
  .card-body { padding: 20px; }
  .card-body h2 { font-size: 20px; }
  .card-body p { font-size: 14.5px; }
  .entry-content { font-size: 16px; }
  .entry-content h2 { font-size: 25px; }
  .entry-content h3 { font-size: 21px; }
  .alignleft,
  .alignright { float: none; margin: 0 0 20px; }
  .footer-inner {
    min-height: 0;
    padding: 28px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
