/*
Theme Name: FixNest Pro
Theme URI: https://ifixit.org.uk/
Author: iFixit UK
Author URI: https://ifixit.org.uk/
Description: A modern, premium repair-guide WordPress theme with a gradient hero, icon-based category navigation, and polished post cards. Built for ifixit.org.uk.
Version: 1.0.2
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: fixnest-pro
Tags: blog, news, custom-menu, featured-images, translation-ready, threaded-comments, right-sidebar, one-column
*/

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
  --navy: #0b1e3a;
  --navy-2: #142b52;
  --blue: #1f7aec;
  --blue-2: #4fa3ff;
  --orange: #ff8c3d;
  --green: #17a673;
  --red: #e5484d;
  --bg: #f5f8fc;
  --card: #ffffff;
  --text: #1c2536;
  --muted: #6c7789;
  --border: #e6edf5;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(11, 30, 58, 0.08);
  --shadow-hover: 0 20px 40px rgba(11, 30, 58, 0.16);
  --max: 1180px;
  --font: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  font-size: 16px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--orange); }
.fn-wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ==========================================================================
   Top utility bar
   ========================================================================== */
.fn-topbar {
  background: var(--navy);
  color: #b9c8e0;
  font-size: 12.5px;
  padding: 7px 0;
}
.fn-topbar .fn-wrap { display: flex; justify-content: space-between; align-items: center; }
.fn-topbar a { color: #dce6f5; }
.fn-topbar-links { display: flex; gap: 16px; }

/* ==========================================================================
   Header
   ========================================================================== */
.fn-header {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
}

.fn-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
}

.fn-logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 21px; color: var(--navy); }
.fn-logo-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--orange));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
  box-shadow: 0 6px 16px rgba(31,122,236,0.35);
}
.fn-logo img { max-height: 42px; }

.fn-nav ul { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; }
.fn-nav a {
  color: var(--navy); font-weight: 600; font-size: 14.5px;
  padding: 9px 14px; border-radius: 999px; display: inline-block;
}
.fn-nav a:hover { background: var(--blue); color: #fff; }

.fn-header-cta {
  display: flex; align-items: center; gap: 14px;
}
.fn-icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--navy); font-size: 16px; cursor: pointer;
}
.fn-icon-btn:hover { background: var(--blue); color: #fff; }

.fn-menu-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--navy); cursor: pointer; }

@media (max-width: 860px) {
  .fn-nav { display: none; width: 100%; order: 3; }
  .fn-nav.fn-nav-open { display: block; }
  .fn-nav ul { flex-direction: column; gap: 2px; padding: 10px 0; }
  .fn-nav a { display: block; }
  .fn-header-inner { flex-wrap: wrap; }
  .fn-menu-toggle { display: block; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.fn-hero {
  position: relative;
  background: radial-gradient(120% 140% at 15% 0%, #1a3d78 0%, var(--navy) 45%, #081327 100%);
  color: #fff;
  padding: 76px 0 56px;
  overflow: hidden;
}
.fn-hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(360px 240px at 88% 12%, rgba(31,122,236,0.35), transparent 70%),
    radial-gradient(320px 220px at 100% 90%, rgba(255,140,61,0.25), transparent 70%);
  pointer-events: none;
}
.fn-hero-inner { position: relative; z-index: 2; max-width: 720px; }
.fn-hero .fn-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
  padding: 6px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: #cfe0ff; margin-bottom: 18px;
}
.fn-hero h1 { font-size: clamp(32px, 4.2vw, 48px); font-weight: 800; margin: 0 0 16px; line-height: 1.2; }
.fn-hero h1 span { background: linear-gradient(90deg, var(--blue-2), var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fn-hero p { color: #b9c8e0; font-size: 17px; max-width: 560px; margin: 0 0 30px; }

.fn-search-form { display: flex; max-width: 520px; background: #fff; border-radius: 999px; padding: 6px; box-shadow: var(--shadow); }
.fn-search-form input[type="search"] { flex: 1; border: none; outline: none; padding: 12px 20px; border-radius: 999px; font-size: 15px; font-family: inherit; }
.fn-search-form button {
  border: none; background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #fff;
  padding: 0 26px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 14px;
}
.fn-search-form button:hover { background: var(--orange); }

/* ==========================================================================
   Category icon strip
   ========================================================================== */
.fn-cat-strip {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  margin-top: -28px;
  position: relative;
  z-index: 3;
}
.fn-cat-strip-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
  transform: translateY(0);
}
.fn-cat-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 22px 10px; text-align: center;
  border-right: 1px solid var(--border);
  color: var(--navy); font-weight: 700; font-size: 13px;
}
.fn-cat-item:last-child { border-right: none; }
.fn-cat-item .fn-cat-icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff;
}
.fn-cat-item:hover { background: var(--bg); }
.fn-cat-item.icon-phone .fn-cat-icon { background: var(--blue); }
.fn-cat-item.icon-laptop .fn-cat-icon { background: var(--navy); }
.fn-cat-item.icon-buying .fn-cat-icon { background: var(--orange); }
.fn-cat-item.icon-tips .fn-cat-icon { background: var(--green); }
.fn-cat-item.icon-replace .fn-cat-icon { background: var(--red); }

@media (max-width: 760px) {
  .fn-cat-strip-inner { grid-template-columns: repeat(3, 1fr); }
  .fn-cat-item:nth-child(3) { border-right: none; }
}
@media (max-width: 480px) {
  .fn-cat-strip-inner { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Layout
   ========================================================================== */
.fn-layout { display: grid; grid-template-columns: 2.2fr 1fr; gap: 40px; padding: 56px 0 70px; }
@media (max-width: 900px) { .fn-layout { grid-template-columns: 1fr; } }

.fn-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.fn-section-head h2 { font-size: 24px; margin: 0; color: var(--navy); }
.fn-section-head .fn-line { flex: 1; height: 1px; background: var(--border); margin: 0 18px; }

/* ==========================================================================
   Post cards
   ========================================================================== */
.fn-card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
@media (max-width: 640px) { .fn-card-grid { grid-template-columns: 1fr; } }

.fn-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fn-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }

.fn-card-thumb { position: relative; height: 190px; overflow: hidden; background: linear-gradient(135deg,#eaf2ff,#f5f8fc); }
.fn-card-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform 0.35s ease; }
.fn-card:hover .fn-card-thumb img { transform: scale(1.06); }

.fn-card-category {
  position: absolute; top: 14px; left: 14px;
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 6px 14px; border-radius: 999px; backdrop-filter: blur(4px);
}
.fn-card-category.cat-phone { background: rgba(31,122,236,0.92); }
.fn-card-category.cat-laptop { background: rgba(11,30,58,0.92); }
.fn-card-category.cat-buying { background: rgba(255,140,61,0.92); }
.fn-card-category.cat-tips { background: rgba(23,166,115,0.92); }
.fn-card-category.cat-repair-replace { background: rgba(229,72,77,0.92); }

.fn-card-body { padding: 20px 22px 24px; min-height: 148px; display: flex; flex-direction: column; }
.fn-card-body h2, .fn-card-body h3 { font-size: 18px; margin: 0 0 10px; line-height: 1.4; }
.fn-card-body h2 a, .fn-card-body h3 a { color: var(--navy); }
.fn-card-excerpt { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.fn-card-meta { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--border); }
.fn-card-meta .fn-avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color:#fff; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; }

/* ==========================================================================
   Sidebar
   ========================================================================== */
.fn-sidebar .widget { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 24px; box-shadow: var(--shadow); }
.fn-sidebar .widget-title { font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--navy); margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.fn-sidebar .widget-title::before { content:""; width: 4px; height: 16px; background: linear-gradient(180deg, var(--blue), var(--orange)); border-radius: 2px; }
.fn-sidebar ul { list-style: none; margin: 0; padding: 0; }
.fn-sidebar li { padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.fn-sidebar li:last-child { border-bottom: none; }
.fn-sidebar li a { color: var(--text); }
.fn-sidebar li a:hover { color: var(--blue); }

.fn-cta-box {
  background: linear-gradient(135deg, var(--navy), #1a3d78);
  color: #fff; border-radius: var(--radius-lg); padding: 26px; text-align: center;
}
.fn-cta-box h3 { margin: 0 0 8px; font-size: 17px; }
.fn-cta-box p { color: #b9c8e0; font-size: 13.5px; margin: 0 0 16px; }

.fn-ad-space { padding: 18px; }
.fn-ad-label {
  display: block; text-align: center; font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}
.fn-ad-placeholder {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  min-height: 250px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 20px;
  font-size: 13px; color: var(--muted);
  background: var(--bg);
}

/* ==========================================================================
   Single post featured image — contained size (like businesstomark)
   ========================================================================== */
.fn-single-thumb {
  margin: 0 0 28px;
  border-radius: 14px;
  overflow: hidden;
  max-width: 640px;
}
.fn-single-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Single post
   ========================================================================== */
.fn-single { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 36px clamp(20px, 5vw, 52px); border: 1px solid var(--border); }
.fn-single .fn-card-category { position: static; display: inline-block; margin-bottom: 16px; }
.fn-single h1 { font-size: clamp(26px, 4vw, 38px); color: var(--navy); margin: 0 0 16px; line-height: 1.25; font-weight: 800; }
.fn-single-meta { color: var(--muted); font-size: 14px; margin-bottom: 26px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.fn-single-meta .fn-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color:#fff; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; }

.fn-single-content h2 { color: var(--navy); margin-top: 40px; font-size: 25px; font-weight: 800; }
.fn-single-content h3 { color: var(--navy); margin-top: 30px; font-size: 20px; font-weight: 700; }
.fn-single-content p { margin: 0 0 18px; }
.fn-single-content a { text-decoration: underline; }
.fn-single-content blockquote {
  border-left: 4px solid var(--blue); background: #eef5ff; margin: 24px 0; padding: 16px 22px; border-radius: 0 12px 12px 0; color: var(--navy); font-style: italic;
}
.fn-single-content table { width: 100%; border-collapse: collapse; margin: 22px 0; border-radius: 12px; overflow: hidden; }
.fn-single-content th, .fn-single-content td { border: 1px solid var(--border); padding: 12px 16px; text-align: left; font-size: 14px; }
.fn-single-content th { background: var(--navy); color: #fff; }
.fn-single-content tr:nth-child(even) td { background: var(--bg); }

.fn-tags { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 8px; }
.fn-tags a { background: var(--bg); color: var(--blue); padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); }
.fn-tags a:hover { background: var(--blue); color: #fff; }

/* ==========================================================================
   Pagination & Buttons
   ========================================================================== */
.fn-pagination { display: flex; gap: 8px; margin-top: 34px; flex-wrap: wrap; }
.fn-pagination a, .fn-pagination span { padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border); background: #fff; font-size: 14px; color: var(--navy); font-weight: 600; }
.fn-pagination a:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.fn-pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }

.fn-btn { display: inline-block; background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #fff; padding: 12px 26px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.fn-btn:hover { background: var(--orange); color: #fff; }

/* ==========================================================================
   Footer
   ========================================================================== */
.fn-footer { background: var(--navy); color: #b9c8e0; margin-top: 60px; padding: 56px 0 0; }
.fn-footer a { color: #dce6f5; }
.fn-footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; margin-bottom: 40px; }
@media (max-width: 800px) { .fn-footer-grid { grid-template-columns: repeat(2, 1fr); } }
.fn-footer h4 { font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.06em; color: #fff; margin: 0 0 16px; }
.fn-footer ul { list-style: none; padding: 0; margin: 0; }
.fn-footer li { margin-bottom: 10px; font-size: 14px; }
.fn-footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: #fff; margin-bottom: 12px; }
.fn-footer-desc { font-size: 14px; color: #93a7c3; max-width: 280px; }
.fn-footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 20px 0; font-size: 13px; text-align: center; color: #7f92b0; }

/* ==========================================================================
   Comments
   ========================================================================== */
.comment-form input, .comment-form textarea { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; font-family: inherit; }
.comment-form button { background: var(--blue); color: #fff; border: none; padding: 12px 26px; border-radius: 999px; font-weight: 700; cursor: pointer; }
.comment-form button:hover { background: var(--orange); }
