/*
Theme Name: Fredblearn
Theme URI: https://example.com/fredblearn
Author: Fredblearn
Author URI: https://example.com
Description: Responsive WordPress theme for the Fredblearn online teaching and learning platform. Designed to work with the Fredblearn Core plugin.
Version: 1.0.1
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fredblearn
Tags: education, e-learning, custom-logo, responsive-layout, accessibility-ready
*/

:root {
  --fbl-primary: #1457d9;
  --fbl-primary-dark: #0e3d99;
  --fbl-accent: #f6b932;
  --fbl-ink: #152033;
  --fbl-muted: #637083;
  --fbl-bg: #f5f7fb;
  --fbl-card: #ffffff;
  --fbl-border: #dfe6f2;
  --fbl-radius: 22px;
  --fbl-shadow: 0 18px 45px rgba(21, 32, 51, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--fbl-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  background: var(--fbl-bg);
}
a { color: var(--fbl-primary); text-decoration: none; }
a:hover { color: var(--fbl-primary-dark); }
img { max-width: 100%; height: auto; }

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

.fbl-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(223, 230, 242, .72);
}
.fbl-container {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}
.fbl-header-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.fbl-brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 900; font-size: 1.28rem; color: var(--fbl-ink); }
.fbl-brand-mark {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, var(--fbl-primary), #44a2ff); color: #fff; box-shadow: 0 12px 24px rgba(20, 87, 217, .25);
}
.fbl-nav { display: flex; align-items: center; gap: 20px; }
.fbl-nav ul { display: flex; align-items: center; gap: 18px; list-style: none; padding: 0; margin: 0; }
.fbl-nav a { font-weight: 700; color: var(--fbl-ink); }
.fbl-nav a:hover { color: var(--fbl-primary); }
.fbl-menu-toggle { display: none; border: 0; background: var(--fbl-primary); color: #fff; border-radius: 12px; padding: 10px 12px; font-weight: 800; }

.fbl-button,
.wp-block-button__link,
button.fbl-button,
input[type="submit"].fbl-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 999px; padding: 13px 20px;
  background: var(--fbl-primary); color: #fff; font-weight: 800;
  box-shadow: 0 14px 32px rgba(20, 87, 217, .22); cursor: pointer;
}
.fbl-button:hover { color: #fff; background: var(--fbl-primary-dark); transform: translateY(-1px); }
.fbl-button--ghost { background: #fff; color: var(--fbl-primary); border: 1px solid var(--fbl-border); box-shadow: none; }
.fbl-button--ghost:hover { background: #edf4ff; color: var(--fbl-primary-dark); }

.fbl-hero {
  position: relative;
  overflow: hidden;
  padding: 86px 0 72px;
  background:
    radial-gradient(circle at 12% 12%, rgba(246,185,50,.28), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(68,162,255,.22), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f4f7fc 100%);
}
.fbl-hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr); gap: 44px; align-items: center; }
.fbl-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--fbl-primary-dark); font-weight: 900; background: #eaf2ff; padding: 8px 13px; border-radius: 999px; }
.fbl-hero h1 { margin: 18px 0 14px; font-size: clamp(2.35rem, 5vw, 4.8rem); line-height: 1.02; letter-spacing: -.055em; }
.fbl-hero p { color: var(--fbl-muted); font-size: 1.12rem; max-width: 680px; }
.fbl-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.fbl-hero-card {
  background: var(--fbl-card); border: 1px solid rgba(223,230,242,.86); border-radius: 34px; padding: 28px;
  box-shadow: var(--fbl-shadow); position: relative;
}
.fbl-hero-card:before {
  content: ""; position: absolute; inset: 18px 18px auto auto; width: 74px; height: 74px; border-radius: 22px;
  background: linear-gradient(135deg, rgba(246,185,50,.95), rgba(255,232,160,.9)); z-index: 0;
}
.fbl-lesson-preview { position: relative; z-index: 1; display: grid; gap: 14px; }
.fbl-preview-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px; border: 1px solid var(--fbl-border); border-radius: 18px; background: #fff; }
.fbl-preview-row strong { display: block; }
.fbl-pill { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: #ecfff6; color: #137948; font-size: .8rem; font-weight: 900; }

.fbl-section { padding: 76px 0; }
.fbl-section-header { max-width: 760px; margin: 0 auto 30px; text-align: center; }
.fbl-section-header h2 { font-size: clamp(1.9rem, 3vw, 3.1rem); line-height: 1.08; margin: 0 0 10px; letter-spacing: -.035em; }
.fbl-section-header p { color: var(--fbl-muted); margin: 0; }
.fbl-grid { display: grid; gap: 20px; }
.fbl-grid--4 { grid-template-columns: repeat(4, 1fr); }
.fbl-grid--3 { grid-template-columns: repeat(3, 1fr); }
.fbl-card {
  background: var(--fbl-card); border: 1px solid var(--fbl-border); border-radius: var(--fbl-radius); padding: 24px; box-shadow: 0 12px 30px rgba(21, 32, 51, .05);
}
.fbl-card h3 { margin: 0 0 8px; font-size: 1.18rem; }
.fbl-card p { color: var(--fbl-muted); margin: 0; }
.fbl-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 16px; margin-bottom: 14px; background: #eaf2ff; color: var(--fbl-primary); font-weight: 900; }

.fbl-main { min-height: 55vh; }
.fbl-content-wrap { padding: 54px 0; }
.fbl-page-card { background: #fff; border: 1px solid var(--fbl-border); border-radius: 28px; padding: clamp(22px, 4vw, 42px); box-shadow: var(--fbl-shadow); }
.fbl-page-title { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.07; letter-spacing: -.04em; margin: 0 0 18px; }
.entry-content :where(h2,h3,h4) { line-height: 1.2; letter-spacing: -.02em; }
.entry-content :where(table) { width: 100%; border-collapse: collapse; }
.entry-content :where(th,td) { border: 1px solid var(--fbl-border); padding: 10px; }

.fbl-cta { padding: 76px 0; }
.fbl-cta-box { background: linear-gradient(135deg, #103d96, #1457d9); color: #fff; border-radius: 34px; padding: clamp(28px, 5vw, 52px); display: grid; grid-template-columns: 1.2fr auto; gap: 24px; align-items: center; box-shadow: 0 22px 55px rgba(20, 87, 217, .25); }
.fbl-cta-box p { margin: 8px 0 0; color: rgba(255,255,255,.82); }
.fbl-cta-box h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 3rem); letter-spacing: -.035em; }

.fbl-site-footer { background: #101827; color: #e9eef8; padding: 42px 0; }
.fbl-footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: center; }
.fbl-footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.fbl-footer-links a { color: #d7e3f8; }
.fbl-footer-links a:hover { color: #fff; }

@media (max-width: 900px) {
  .fbl-hero-grid, .fbl-cta-box, .fbl-footer-grid { grid-template-columns: 1fr; }
  .fbl-grid--4, .fbl-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .fbl-menu-toggle { display: inline-flex; }
  .fbl-nav { position: absolute; inset: 78px 18px auto; display: none; flex-direction: column; align-items: stretch; padding: 18px; background: #fff; border: 1px solid var(--fbl-border); border-radius: 18px; box-shadow: var(--fbl-shadow); }
  .fbl-nav.is-open { display: flex; }
  .fbl-nav ul { flex-direction: column; align-items: stretch; }
}
@media (max-width: 620px) {
  .fbl-grid--4, .fbl-grid--3 { grid-template-columns: 1fr; }
  .fbl-container { width: min(100% - 24px, 1180px); }
  .fbl-hero { padding: 54px 0; }
  .fbl-section, .fbl-cta { padding: 48px 0; }
}

/* Fredblearn full-width shell and sticky footer refinements.
   Keeps the header/footer as true viewport-width site sections while preventing
   dashboard/homepage 100vw calculations from creating horizontal scrolling. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.admin-bar {
  min-height: calc(100vh - 32px);
}

.fbl-site-header,
.fbl-site-footer {
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
}

.fbl-site-header {
  left: 0;
  right: 0;
}

.fbl-main {
  width: 100%;
  max-width: 100%;
  flex: 1 0 auto;
}

.fbl-site-footer {
  margin-top: auto;
}

@media (max-width: 782px) {
  body.admin-bar {
    min-height: calc(100vh - 46px);
  }
}

