/*
Theme Name: The LaTeX Lab
Theme URI: https://thelatexlab.com
Author: The LaTeX Lab
Author URI: https://thelatexlab.com
Description: Custom lightweight theme for The LaTeX Lab — professional Word to LaTeX and PDF to LaTeX conversion service.
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: thelatexlab
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  --bg: #F0EEE6;
  --bg-sand: #E3DBCC;
  --bg-dark: #141413;
  --text-primary: #141413;
  --text-secondary: #5C5B56;
  --text-on-dark: #F0EEE6;
  --accent: #BF6438;
  --accent-hover: #A8532B;
  --border: #D4CCBD;
  --white: #FFFFFF;
  --font-sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1140px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip; }
body { font-family: var(--font-sans); color: var(--text-primary); background: var(--bg); line-height: 1.7; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
ul, ol { list-style: none; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4 { font-weight: 700; color: var(--text-primary); line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.01em; margin-bottom: 1rem; }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.35rem); margin-bottom: 0.75rem; }
p { margin-bottom: 1.25rem; }
.text-muted { color: var(--text-secondary); }
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px); position: absolute !important;
  height: 1px; width: 1px; overflow: hidden; word-wrap: normal !important;
}
.screen-reader-text:focus {
  background: var(--white); color: var(--text-primary);
  display: block; font-size: 0.875rem; font-weight: 700;
  height: auto; width: auto; padding: 16px 24px;
  clip: auto !important; z-index: 100000;
  top: 5px; left: 5px; border-radius: 4px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.1);
}

/* ============================================
   LAYOUT
   ============================================ */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.page-section { padding: 0 0 80px; }
.divider { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.divider-inner { height: 1px; background: var(--border); margin-bottom: 80px; }

@media (max-width: 768px) {
  .page-section { padding: 0 0 60px; }
  .divider-inner { margin-bottom: 60px; }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 600; font-size: 1rem;
  padding: 14px 28px; border-radius: 8px; border: none; cursor: pointer;
  transition: all 0.2s; text-decoration: none; line-height: 1.2;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-hover); color: var(--white); }
.btn-secondary { background: transparent; color: var(--text-primary); border: 2px solid var(--text-primary); }
.btn-secondary:hover { background: var(--text-primary); color: var(--bg); }
.btn-outline { background: transparent; color: var(--text-secondary); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 10px 20px; font-size: 0.9rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-group { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

@media (max-width: 480px) {
  .btn-lg { padding: 14px 28px; font-size: 1rem; }
  .btn-group { flex-direction: column; width: 100%; }
  .btn-group .btn { width: 100%; }
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--bg); border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
.site-header.scrolled { box-shadow: 0 2px 20px rgba(20, 20, 19, 0.06); }
.header-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 72px;
}
.site-logo { font-size: 1.35rem; text-decoration: none; display: inline-flex; align-items: center; }
.logo-the { color: var(--accent); font-weight: 400; }
.logo-latex { font-weight: 700; color: var(--text-primary); }
.logo-lab { font-weight: 400; color: var(--text-primary); }

/* Desktop nav */
.main-nav { display: flex; align-items: center; gap: 32px; }
.main-nav a { color: var(--text-primary); font-size: 0.95rem; font-weight: 400; text-decoration: none; }
.main-nav a:hover { color: var(--accent); }
.main-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { background: none; border: none; font: inherit; color: inherit; cursor: pointer; padding: 0; display: flex; align-items: center; gap: 4px; }
.nav-dropdown-toggle::after { content: ''; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid currentColor; margin-top: 2px; }
.nav-dropdown-content {
  display: none; position: absolute; top: 100%; left: -16px;
  background: var(--white); border: 1px solid var(--border); border-radius: 8px;
  padding: 20px 0 12px; min-width: 220px; box-shadow: 0 8px 30px rgba(20, 20, 19, 0.08);
}
.nav-dropdown-content a { display: block; padding: 8px 20px; font-size: 0.9rem; }
.nav-dropdown-content a:hover { background: var(--bg); }
.nav-dropdown.open .nav-dropdown-content { display: block; }
.nav-cta {
  background: var(--accent); color: var(--white) !important; padding: 10px 22px;
  border-radius: 8px; font-weight: 600; font-size: 0.9rem; transition: background 0.2s;
}
.nav-cta:hover { background: var(--accent-hover); color: var(--white) !important; }

/* Mobile nav toggle */
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 40px; height: 40px; position: relative;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--text-primary);
  border-radius: 2px; transition: all 0.3s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translateY(5px); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translateY(-5px); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 24px; gap: 16px;
    box-shadow: 0 8px 30px rgba(20, 20, 19, 0.08);
  }
  .main-nav.open { display: flex; }
  .nav-dropdown-content {
    position: static; box-shadow: none; border: none;
    background: transparent; padding: 8px 0 0 16px; min-width: 0;
  }
  .nav-dropdown.open .nav-dropdown-content { display: block; }
  .nav-cta { text-align: center; width: 100%; display: block; }
}

/* ============================================
   TRUST STRIP
   ============================================ */
.trust-strip { padding: 40px 0; background: var(--bg-sand); }
.trust-strip-label {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-secondary); margin-bottom: 20px; text-align: center;
}
.trust-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.trust-badge {
  padding: 8px 20px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); background: var(--white);
}
@media (max-width: 480px) {
  .trust-badges { gap: 8px; }
  .trust-badge { padding: 6px 14px; font-size: 0.75rem; }
}

/* ============================================
   FAQ + CALENDLY
   ============================================ */
.faq-layout { display: grid; grid-template-columns: 1fr 400px; gap: 48px; align-items: start; }
.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item:first-child { border-top: 1px solid var(--border); }
.faq-question {
  font-weight: 700; font-size: 1rem; color: var(--text-primary); cursor: pointer;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  background: none; border: none; width: 100%; text-align: left; font-family: var(--font-sans);
  padding: 0; line-height: 1.5;
}
.faq-question::after {
  content: '+'; font-size: 1.3rem; font-weight: 400; color: var(--text-secondary);
  flex-shrink: 0; line-height: 1;
}
.faq-item.active .faq-question::after { content: '−'; }
.faq-answer {
  display: none; font-size: 0.92rem; color: var(--text-secondary);
  line-height: 1.7; padding-top: 12px; padding-right: 40px;
}
.faq-item.active .faq-answer { display: block; }
.calendly-sidebar { position: sticky; top: 96px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.calendly-sidebar-label { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0; padding: 16px 20px; }

@media (max-width: 900px) {
  .faq-layout { grid-template-columns: 1fr; }
  .calendly-sidebar { position: static; }
}

/* ============================================
   CTA SECTION (dark)
   ============================================ */
.cta-section { background: var(--bg-dark); text-align: center; padding: 100px 0; }
.cta-section h2 { color: var(--text-on-dark); margin-bottom: 1rem; }
.cta-section p { color: #8a877f; max-width: 600px; margin: 0 auto 2rem; font-size: 1.05rem; }
.cta-alt-links { margin-top: 1.5rem; font-size: 0.9rem; color: #6B6961; }
.cta-alt-links a { color: #8a877f; }
.cta-alt-links a:hover { color: var(--accent); }
.cta-guarantees {
  margin-top: 2rem; display: flex; justify-content: center;
  flex-wrap: wrap; gap: 20px; font-size: 0.85rem; color: #8a877f;
}
.cta-guarantees span::before { content: '✓ '; color: var(--accent); font-weight: 700; }

@media (max-width: 768px) {
  .cta-section { padding: 72px 0; }
}
@media (max-width: 480px) {
  .cta-guarantees { flex-direction: column; align-items: center; gap: 8px; }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer { background: var(--bg-dark); color: var(--text-on-dark); padding: 0 0 32px; }
.footer-divider { border: none; border-top: 1px solid #2A2A28; margin: 0 auto 48px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand .site-logo { font-size: 1.2rem; margin-bottom: 16px; display: inline-block; }
.footer-brand .logo-latex, .footer-brand .logo-lab { color: var(--text-on-dark); }
.footer-brand p { color: #A09E97; font-size: 0.9rem; line-height: 1.6; max-width: 300px; }
.footer-col h4 {
  color: var(--text-on-dark); font-size: 0.82rem; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 16px;
}
.footer-col a { display: block; color: #A09E97; font-size: 0.9rem; padding: 4px 0; transition: color 0.2s; }
.footer-col { min-width: 0; }
.footer-col a:hover { color: var(--accent); }
.footer-post-link {
  display: block; color: #A09E97; font-size: 0.9rem; padding: 4px 0;
  transition: color 0.2s; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 100%;
}
.footer-post-link:hover { color: var(--accent); }
.footer-col-h4-second { margin-top: 28px; }
.footer-bottom {
  border-top: 1px solid #2A2A28; padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.85rem; color: #6B6961;
}
.footer-bottom-right { display: flex; align-items: center; gap: 32px; }
.footer-bottom-resources { display: flex; gap: 20px; }
.footer-bottom-resources a { color: #6B6961; font-size: 0.8rem; text-decoration: none; transition: color 0.2s; }
.footer-bottom-resources a:hover { color: var(--accent); }
.footer-social { display: flex; gap: 16px; }
.footer-social a { color: #6B6961; font-size: 0.85rem; }
.footer-social a:hover { color: var(--accent); }
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column-reverse; gap: 12px; text-align: center; }
  .footer-bottom-right { flex-direction: column; align-items: center; gap: 16px; }
  .footer-bottom-resources { flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
/* ============================================
   AUTHOR BYLINE & BIO BOX
   ============================================ */
.author-byline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}
.author-byline a {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
}
.author-byline a:hover { color: var(--accent); }

.author-bio-box {
  display: flex;
  gap: 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 24px 28px;
  margin: 40px 0;
}
.author-bio-avatar { flex-shrink: 0; }
.author-bio-avatar img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}
.author-bio-name {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  margin-bottom: 2px;
}
.author-bio-name:hover { color: var(--accent); }
.author-bio-role {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 600;
}
.author-bio-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}
.author-bio-link {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.author-bio-link:hover { color: var(--accent-hover); }

@media (max-width: 600px) {
  .author-bio-box { flex-direction: column; gap: 14px; }
}