/*
Theme Name: Fraction
Theme URI: https://fractionservers.com
Author: Fraction Servers
Author URI: https://fractionservers.com
Description: A clean, modern blog theme inspired by the Fraction Servers brand. Features a dark hero header, orange accent colour, Montserrat typography, and responsive layout.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fraction
*/

/* ─── VARIABLES ─── */
:root {
  --bg-hero: #243447;
  --bg-dark: #1e2d3d;
  --bg-darker: #192736;
  --bg-darkest: #142230;
  --bg-light: #f5f7fa;
  --bg-white: #ffffff;
  --bg-card-dark: #2a3f52;
  --bg-card-dark-hover: #304858;
  --border-dark: #344a5e;
  --border-light: #e2e6ec;
  --text-white: #ffffff;
  --text-light: #c8d3de;
  --text-muted-light: #8a9bb0;
  --text-dark: #2c3e50;
  --text-body: #5a6a7a;
  --orange: #e8734a;
  --orange-hover: #d4633c;
  --orange-light: rgba(232,115,74,0.12);
  --green: #34c759;
  --font: 'Montserrat', sans-serif;
}

/* ─── RESET ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-white);
  color: var(--text-dark);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

a { color: var(--orange); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--orange-hover); }
img { max-width: 100%; height: auto; }

/* ─── NAV ─── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 3rem; height: 80px;
  display: flex; align-items: center; justify-content: space-between;
  background: transparent;
  transition: background 0.35s, box-shadow 0.35s;
  border-bottom: 1px solid transparent;
}
.site-nav.scrolled {
  background: var(--bg-white);
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
  border-bottom-color: var(--border-light);
}
.site-logo {
  display: flex; align-items: center;
  text-decoration: none; font-size: 1.2rem; font-weight: 800;
  color: var(--text-white); letter-spacing: -0.02em;
  position: relative;
}
.site-nav.scrolled .site-logo { color: var(--text-dark); }
.site-logo img { height: 46px; width: auto; transition: opacity 0.3s; }
.site-logo .logo-dark {
  position: absolute; top: 0; left: 0; opacity: 0;
}
.site-nav.scrolled .site-logo .logo-light { opacity: 0; }
.site-nav.scrolled .site-logo .logo-dark { opacity: 1; }
/* Footer always shows light logo */
.site-footer .site-logo .logo-light { opacity: 1; }
.site-footer .site-logo .logo-dark { opacity: 0; }

.nav-links {
  display: flex; align-items: center; gap: 0.25rem; list-style: none;
}
.nav-links li a {
  color: var(--text-light); text-decoration: none;
  font-size: 0.88rem; font-weight: 500;
  padding: 0.5rem 1rem; border-radius: 6px;
  transition: color 0.3s;
}
.nav-links li a:hover,
.nav-links li.current-menu-item a { color: var(--orange); }
.site-nav.scrolled .nav-links li a { color: var(--text-body); }
.site-nav.scrolled .nav-links li a:hover,
.site-nav.scrolled .nav-links li.current-menu-item a { color: var(--orange); }

.mobile-toggle {
  display: none; background: none; border: none;
  color: var(--text-white); font-size: 1.5rem; cursor: pointer;
  transition: color 0.3s;
}
.site-nav.scrolled .mobile-toggle { color: var(--text-dark); }

/* ─── HERO (front page) ─── */
.hero {
  position: relative; min-height: 60vh;
  display: flex; align-items: center;
  padding: 8rem 3rem 5rem;
  background: linear-gradient(135deg, #1b3248 0%, #24445e 40%, #2a5068 100%);
  text-align: center;
}
.hero-inner {
  max-width: 760px; margin: 0 auto; position: relative; z-index: 2;
}
.hero-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--orange); margin-bottom: 1.25rem;
  animation: fadeUp 0.7s ease both;
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 800;
  line-height: 1.15; letter-spacing: -0.02em;
  color: var(--text-white);
  animation: fadeUp 0.7s ease 0.1s both;
}
.hero .subtitle {
  font-size: 1rem; color: var(--text-light);
  max-width: 540px; margin: 1.25rem auto 0;
  font-weight: 400; line-height: 1.7;
  animation: fadeUp 0.7s ease 0.2s both;
}

/* ─── PAGE HEADER (non-front pages) ─── */
.page-header {
  background: linear-gradient(135deg, #1b3248 0%, #24445e 40%, #2a5068 100%);
  padding: 7rem 3rem 4rem; text-align: center;
}
.page-header h1 {
  font-size: 2.2rem; font-weight: 700;
  color: var(--text-white); margin-bottom: 0.75rem;
}
.breadcrumb {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; font-size: 0.85rem; color: var(--text-light);
}
.breadcrumb a { color: var(--text-light); text-decoration: none; }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb .sep { color: var(--text-muted-light); }
.breadcrumb .current { color: var(--text-white); font-weight: 600; }

/* ─── LAYOUT ─── */
.site-content {
  max-width: 1180px; margin: 0 auto;
  padding: 3.5rem 3rem 5rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
}
.site-content.full-width {
  grid-template-columns: 1fr;
  max-width: 860px;
}

/* ─── POSTS ─── */
.post {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border-light);
}
.post:last-child { border-bottom: none; }

.post-thumbnail {
  border-radius: 10px; overflow: hidden;
  margin-bottom: 1.5rem;
}
.post-thumbnail img {
  width: 100%; height: auto; display: block;
  transition: transform 0.3s;
}
.post:hover .post-thumbnail img { transform: scale(1.02); }

.post-meta {
  font-size: 0.78rem; color: var(--text-muted-light);
  margin-bottom: 0.6rem; display: flex;
  align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.post-meta a { color: var(--orange); font-weight: 600; }

.post-title {
  font-size: 1.5rem; font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 0.6rem; line-height: 1.3;
}
.post-title a { color: var(--text-dark); text-decoration: none; }
.post-title a:hover { color: var(--orange); }

.post-excerpt {
  font-size: 0.92rem; color: var(--text-body);
  line-height: 1.9; margin-bottom: 1.25rem;
}

.read-more {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.4rem; border-radius: 25px;
  font-size: 0.82rem; font-weight: 600;
  background: var(--orange); color: var(--text-white);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.read-more:hover {
  background: var(--orange-hover); color: var(--text-white);
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(232,115,74,0.35);
}

/* ─── SINGLE POST ─── */
.single-post-content {
  max-width: 860px; margin: 0 auto;
  padding: 3.5rem 3rem 5rem;
}
.single-post-content .post-title {
  font-size: 2rem; margin-bottom: 0.75rem;
}
.entry-content h2 {
  font-size: 1.3rem; font-weight: 800;
  color: var(--text-dark);
  margin: 2.75rem 0 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}
.entry-content h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.entry-content h3 {
  font-size: 1rem; font-weight: 700;
  color: var(--text-dark); margin: 2rem 0 0.6rem;
}
.entry-content p {
  font-size: 0.92rem; color: var(--text-body);
  line-height: 1.95; margin-bottom: 1.25rem;
}
.entry-content ul, .entry-content ol {
  margin: 0.75rem 0 1.25rem 1.5rem;
}
.entry-content li {
  font-size: 0.9rem; color: var(--text-body);
  line-height: 1.9; margin-bottom: 0.5rem;
}
.entry-content blockquote {
  border-left: 3px solid var(--orange);
  padding: 1rem 1.5rem; margin: 1.5rem 0;
  background: var(--bg-light); border-radius: 0 8px 8px 0;
}
.entry-content blockquote p {
  font-style: italic; color: var(--text-dark); margin-bottom: 0;
}
.entry-content pre {
  background: var(--bg-darkest); color: var(--text-light);
  padding: 1.25rem 1.5rem; border-radius: 8px;
  overflow-x: auto; font-size: 0.85rem;
  margin: 1.25rem 0; line-height: 1.6;
}
.entry-content code {
  background: var(--bg-light); padding: 0.15rem 0.4rem;
  border-radius: 4px; font-size: 0.85rem;
}
.entry-content pre code {
  background: none; padding: 0;
}
.entry-content img {
  border-radius: 8px; margin: 1rem 0;
}
.entry-content a { color: var(--orange); }
.entry-content a:hover { text-decoration: underline; }

/* ─── TAGS ON SINGLE POST ─── */
.post-tags {
  margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}
.post-tags a {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  background: var(--orange-light); color: var(--orange);
  padding: 0.3rem 0.75rem; border-radius: 20px;
  margin: 0.25rem 0.25rem 0.25rem 0;
  text-decoration: none; transition: background 0.2s;
}
.post-tags a:hover { background: var(--orange); color: var(--text-white); }

/* ─── POST NAVIGATION ─── */
.post-navigation {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.5rem; margin-top: 3rem; padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}
.post-navigation a {
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-dark); text-decoration: none;
}
.post-navigation a:hover { color: var(--orange); }
.post-navigation .nav-next { text-align: right; }
.post-navigation .nav-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted-light);
  margin-bottom: 0.3rem;
}

/* ─── COMMENTS ─── */
.comments-area {
  margin-top: 3rem; padding-top: 2rem;
  border-top: 2px solid var(--border-light);
}
.comments-title {
  font-size: 1.2rem; font-weight: 800; margin-bottom: 1.5rem;
}
.comment-list {
  list-style: none; padding: 0; margin: 0;
}
.comment {
  padding: 1.5rem 0; border-bottom: 1px solid var(--border-light);
}
.comment-author {
  font-size: 0.88rem; font-weight: 700; color: var(--text-dark);
}
.comment-meta {
  font-size: 0.75rem; color: var(--text-muted-light); margin-bottom: 0.5rem;
}
.comment-body p {
  font-size: 0.88rem; color: var(--text-body); line-height: 1.7;
}

.comment-respond { margin-top: 2rem; }
.comment-respond h3 {
  font-size: 1.1rem; font-weight: 800; margin-bottom: 1rem;
}
.comment-form label {
  font-size: 0.82rem; font-weight: 600; color: var(--text-dark);
  display: block; margin-bottom: 0.3rem;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%; padding: 0.7rem 1rem;
  border: 1px solid var(--border-light); border-radius: 8px;
  font-family: var(--font); font-size: 0.88rem;
  margin-bottom: 1rem; transition: border-color 0.2s;
}
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none; border-color: var(--orange);
}
.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form .submit {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.75rem 1.6rem; border-radius: 25px;
  font-family: var(--font); font-size: 0.88rem; font-weight: 600;
  background: var(--orange); color: var(--text-white);
  border: none; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.comment-form .submit:hover {
  background: var(--orange-hover); transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(232,115,74,0.35);
}

/* ─── SIDEBAR ─── */
.sidebar .widget {
  margin-bottom: 2.5rem;
}
.sidebar .widget-title {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-dark); margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--orange);
}
.sidebar .widget ul {
  list-style: none; padding: 0;
}
.sidebar .widget li {
  margin-bottom: 0.5rem;
}
.sidebar .widget li a {
  color: var(--text-body); text-decoration: none;
  font-size: 0.85rem; transition: color 0.2s;
}
.sidebar .widget li a:hover { color: var(--orange); }

/* Search widget */
.search-form {
  display: flex; gap: 0;
}
.search-form .search-field {
  flex: 1; padding: 0.65rem 1rem;
  border: 1px solid var(--border-light); border-right: none;
  border-radius: 25px 0 0 25px;
  font-family: var(--font); font-size: 0.85rem;
}
.search-form .search-field:focus {
  outline: none; border-color: var(--orange);
}
.search-form .search-submit {
  padding: 0.65rem 1.2rem;
  background: var(--orange); color: var(--text-white);
  border: none; border-radius: 0 25px 25px 0;
  font-family: var(--font); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.search-form .search-submit:hover { background: var(--orange-hover); }

/* ─── PAGINATION ─── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 0.4rem; margin-top: 2rem; padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-body); text-decoration: none;
  border: 1px solid var(--border-light);
  transition: all 0.2s;
}
.pagination .page-numbers:hover { border-color: var(--orange); color: var(--orange); }
.pagination .page-numbers.current {
  background: var(--orange); color: var(--text-white);
  border-color: var(--orange);
}

/* ─── 404 ─── */
.error-404 {
  text-align: center; padding: 5rem 2rem;
}
.error-404 h1 {
  font-size: 4rem; font-weight: 800; color: var(--orange);
}
.error-404 p {
  font-size: 1rem; color: var(--text-body); margin: 1rem 0 2rem;
}

/* ─── FOOTER ─── */
.site-footer {
  background: var(--bg-darkest); padding: 3rem 3rem 2rem;
}
.footer-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; justify-content: space-between;
  align-items: flex-start; flex-wrap: wrap; gap: 2rem;
}
.footer-info { max-width: 380px; }
.footer-info .site-logo {
  margin-bottom: 0.75rem; color: var(--text-white);
}
.footer-info p {
  font-size: 0.78rem; color: var(--text-muted-light); line-height: 1.7;
}
.footer-cols { display: flex; gap: 3.5rem; }
.footer-col h4 {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-white); margin-bottom: 0.8rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.45rem; }
.footer-col a {
  color: var(--text-muted-light); text-decoration: none;
  font-size: 0.82rem; transition: color 0.2s;
}
.footer-col a:hover { color: var(--orange); }
.footer-bottom {
  max-width: 1180px; margin: 2rem auto 0;
  padding-top: 1.5rem; border-top: 1px solid var(--border-dark);
  font-size: 0.7rem; color: var(--text-muted-light); line-height: 1.8;
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 960px) {
  .site-content {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .site-nav { padding: 0 1.5rem; height: 68px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg-darkest);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-dark);
    gap: 0.25rem; z-index: 99;
  }
  .site-nav.scrolled .nav-links.open {
    background: var(--bg-white);
    border-bottom-color: var(--border-light);
  }
  .mobile-toggle { display: block; }
  .hero { padding: 7rem 1.5rem 4rem; }
  .page-header { padding: 6rem 1.5rem 3rem; }
  .page-header h1 { font-size: 1.7rem; }
  .site-content { padding: 2.5rem 1.5rem 4rem; }
  .single-post-content { padding: 2.5rem 1.5rem 4rem; }
  .post-title { font-size: 1.3rem; }
  .post-navigation { grid-template-columns: 1fr; }
  .footer-cols { gap: 2rem; flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .footer-inner { flex-direction: column; }
  .footer-cols { flex-direction: column; gap: 1.5rem; }
}

/* ─── WP DEFAULTS ─── */
.alignleft { float: left; margin-right: 1.5rem; margin-bottom: 1rem; }
.alignright { float: right; margin-left: 1.5rem; margin-bottom: 1rem; }
.aligncenter { display: block; margin: 1rem auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text {
  font-size: 0.78rem; color: var(--text-muted-light);
  text-align: center; margin-top: 0.5rem;
}
.sticky .post-title::before {
  content: '★ '; color: var(--orange);
}
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important; height: 1px; width: 1px;
  overflow: hidden;
}
