/*
Theme Name: Sidebar Learning Portal
Theme URI: https://example.com/sidebar-learning-portal
Author: Custom Theme
Author URI: https://example.com
Description: A clean responsive WordPress theme with a permanent left sidebar navigation menu, customizable branding, and an advertising sidebar. Manage pages, posts, menus, widgets, colors, homepage text, and footer content from the WordPress dashboard without editing code.
Version: 1.6.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sidebar-learning-portal
Tags: education, custom-menu, custom-logo, featured-images, left-sidebar, responsive-layout, translation-ready
*/

:root {
  --slp-accent: #0754a6;
  --slp-accent-dark: #043b78;
  --slp-accent-soft: #e7f1fc;
  --slp-orange: #ff5b00;
  --slp-orange-dark: #d94700;
  --slp-yellow: #ffbb16;
  --slp-red: #e51c23;
  --slp-bg: #f4f7fb;
  --slp-surface: #ffffff;
  --slp-text: #12243a;
  --slp-muted: #657487;
  --slp-border: #d8e2ee;
  --slp-shadow: 0 10px 30px rgba(7, 84, 166, .09);
  --slp-radius: 14px;
  --slp-sidebar-width: 290px;
  --slp-header-height: 88px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--slp-bg);
  color: var(--slp-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: var(--slp-accent-dark);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--slp-accent);
}

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

button,
input,
textarea,
select {
  font: inherit;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100000;
  width: auto;
  height: auto;
  padding: 12px 16px;
  clip: auto;
  background: #fff;
  color: #000;
  box-shadow: var(--slp-shadow);
}

.site-layout {
  min-height: 100vh;
}

.site-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--slp-sidebar-width);
  overflow-y: auto;
  background: var(--slp-surface);
  border-right: 1px solid var(--slp-border);
  box-shadow: 6px 0 30px rgba(27, 50, 63, .05);
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 28px 22px;
}

.site-branding {
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--slp-border);
}

.custom-logo-link {
  display: inline-block;
  margin-bottom: 12px;
}

.custom-logo {
  max-height: 58px;
  width: auto;
}

.site-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.25;
}

.site-title a {
  color: var(--slp-text);
}

.site-description {
  margin: 7px 0 0;
  color: var(--slp-muted);
  font-size: .9rem;
}

.sidebar-heading {
  margin: 24px 10px 10px;
  color: var(--slp-muted);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar-navigation ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-navigation li {
  position: relative;
  margin: 4px 0;
}

.sidebar-navigation a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #334149;
  font-weight: 650;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.sidebar-navigation a:hover,
.sidebar-navigation a:focus {
  background: var(--slp-accent-soft);
  color: var(--slp-accent-dark);
  transform: translateX(3px);
}

.sidebar-navigation .current-menu-item > a,
.sidebar-navigation .current_page_item > a,
.sidebar-navigation .current-menu-ancestor > a {
  background: var(--slp-accent);
  color: #fff;
}

.sidebar-navigation .sub-menu {
  margin: 5px 0 8px 14px;
  padding-left: 12px;
  border-left: 2px solid var(--slp-border);
}

.sidebar-navigation .sub-menu a {
  min-height: 38px;
  padding: 7px 11px;
  font-size: .92rem;
  font-weight: 550;
}

.sidebar-widgets {
  margin-top: auto;
  padding-top: 24px;
}

.widget {
  margin-bottom: 22px;
}

.widget-title {
  margin: 0 0 10px;
  font-size: 1rem;
}

.widget ul {
  margin: 0;
  padding-left: 18px;
}

.site-content-wrap {
  margin-left: var(--slp-sidebar-width);
  min-height: 100vh;
}

.mobile-header {
  display: none;
}

.content-shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 70px;
}

.page-header,
.entry-card,
.hero,
.empty-state,
.comments-area {
  background: var(--slp-surface);
  border: 1px solid var(--slp-border);
  border-radius: var(--slp-radius);
  box-shadow: var(--slp-shadow);
}

.page-header {
  margin-bottom: 24px;
  padding: 30px 34px;
}

.page-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
}

.archive-description {
  margin-top: 10px;
  color: var(--slp-muted);
}

.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
  padding: clamp(34px, 6vw, 72px);
  background:
    radial-gradient(circle at 90% 10%, rgba(7, 84, 166, .16), transparent 35%),
    linear-gradient(135deg, #fff 0%, #f6fff9 100%);
}

.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 250px;
  height: 250px;
  border: 35px solid rgba(255, 91, 0, .10);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero-kicker {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--slp-accent-soft);
  color: var(--slp-accent-dark);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -.035em;
}

.hero-text {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--slp-muted);
  font-size: 1.08rem;
}

.button,
.wp-block-button__link,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 24px;
  padding: 11px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--slp-accent);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}

.button:hover,
.button:focus,
.wp-block-button__link:hover,
input[type="submit"]:hover {
  background: var(--slp-accent-dark);
  color: #fff;
  transform: translateY(-2px);
}

.home-content,
.entry-card {
  margin-bottom: 24px;
  padding: 32px 34px;
}

.entry-title {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.25;
}

.entry-title a {
  color: var(--slp-text);
}

.entry-title a:hover {
  color: var(--slp-accent);
}

.entry-meta {
  margin-bottom: 18px;
  color: var(--slp-muted);
  font-size: .88rem;
}

.entry-thumbnail {
  margin: 0 0 24px;
  overflow: hidden;
  border-radius: 11px;
}

.entry-thumbnail img {
  display: block;
  width: 100%;
}

.entry-content > *:first-child,
.entry-summary > *:first-child {
  margin-top: 0;
}

.entry-content > *:last-child,
.entry-summary > *:last-child {
  margin-bottom: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  line-height: 1.3;
}

.read-more {
  display: inline-block;
  margin-top: 15px;
  font-weight: 750;
}

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

.post-grid .entry-card {
  margin-bottom: 0;
}

.section-title {
  margin: 34px 0 18px;
  font-size: 1.55rem;
}

.pagination,
.posts-navigation,
.post-navigation {
  margin-top: 28px;
}

.nav-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.nav-links a,
.page-numbers {
  display: inline-flex;
  padding: 9px 13px;
  border: 1px solid var(--slp-border);
  border-radius: 8px;
  background: #fff;
}

.page-numbers.current {
  background: var(--slp-accent);
  color: #fff;
  border-color: var(--slp-accent);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--slp-border);
  border-radius: 9px;
  background: #fff;
  color: var(--slp-text);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.site-footer {
  padding: 24px 0 34px;
  color: var(--slp-muted);
  font-size: .9rem;
  text-align: center;
}

.footer-menu {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.footer-menu li {
  display: inline-block;
  margin: 0 8px;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 9px;
  background: var(--slp-accent);
  color: #fff;
  cursor: pointer;
}

.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block;
  width: 21px;
  height: 2px;
  margin: auto;
  background: currentColor;
  content: "";
}

.menu-toggle-bars {
  position: relative;
}

.menu-toggle-bars::before {
  position: absolute;
  top: -7px;
}

.menu-toggle-bars::after {
  position: absolute;
  top: 7px;
}

.no-menu-message {
  padding: 14px;
  border-radius: 9px;
  background: #fff8e1;
  color: #765b00;
  font-size: .9rem;
}

.alignwide {
  max-width: 1100px;
}

.alignfull {
  width: 100%;
}

@media (max-width: 900px) {
  .site-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
  }

  body.sidebar-open .site-sidebar {
    transform: translateX(0);
  }

  .site-content-wrap {
    margin-left: 0;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--slp-border);
    backdrop-filter: blur(12px);
  }

  .mobile-site-title {
    color: var(--slp-text);
    font-weight: 800;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
  }

  .content-shell {
    width: min(100% - 30px, 820px);
    padding-top: 28px;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero,
  .home-content,
  .entry-card,
  .page-header {
    padding: 24px 22px;
    border-radius: 11px;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .content-shell {
    width: min(100% - 20px, 820px);
  }
}

/* Words101 header and logo-colour design */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--slp-header-height);
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--slp-border);
  box-shadow: 0 5px 20px rgba(7, 84, 166, .06);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(1180px, calc(100% - 44px));
  min-height: var(--slp-header-height);
  margin: 0 auto;
}

.header-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.header-logo {
  display: block;
  width: auto;
  max-width: 220px;
  max-height: 72px;
  object-fit: contain;
}

.header-navigation {
  margin-left: auto;
}

.header-navigation ul,
.header-fallback-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.header-navigation li {
  position: relative;
}

.header-navigation a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 9px;
  color: var(--slp-text);
  font-size: .95rem;
  font-weight: 750;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.header-navigation a:hover,
.header-navigation a:focus {
  background: var(--slp-accent-soft);
  color: var(--slp-accent);
  transform: translateY(-1px);
}

.header-navigation .current-menu-item > a,
.header-navigation .current_page_item > a,
.header-navigation .current-menu-ancestor > a {
  background: var(--slp-accent);
  color: #fff;
}

.header-navigation .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  display: none;
  min-width: 210px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--slp-border);
  border-radius: 11px;
  box-shadow: var(--slp-shadow);
}

.header-navigation li:hover > .sub-menu,
.header-navigation li:focus-within > .sub-menu {
  display: block;
}

.header-navigation .sub-menu a {
  min-height: 40px;
  white-space: nowrap;
}

.site-sidebar {
  border-top: 5px solid var(--slp-orange);
}

.custom-logo {
  max-width: 235px;
  max-height: 105px;
}

.site-title a:hover {
  color: var(--slp-orange);
}

.sidebar-navigation .current-menu-item > a,
.sidebar-navigation .current_page_item > a,
.sidebar-navigation .current-menu-ancestor > a {
  background: linear-gradient(135deg, var(--slp-accent), #0b6fca);
  box-shadow: 0 6px 14px rgba(7, 84, 166, .18);
}

.hero {
  border-top: 4px solid var(--slp-orange);
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 187, 22, .22), transparent 29%),
    radial-gradient(circle at 76% 78%, rgba(255, 91, 0, .11), transparent 28%),
    linear-gradient(135deg, #fff 0%, #f2f8ff 100%);
}

.hero-kicker {
  background: #fff0e7;
  color: var(--slp-orange-dark);
}

.button,
.wp-block-button__link,
input[type="submit"] {
  background: linear-gradient(135deg, var(--slp-orange), #ff7a00);
  box-shadow: 0 8px 18px rgba(255, 91, 0, .18);
}

.button:hover,
.button:focus,
.wp-block-button__link:hover,
input[type="submit"]:hover {
  background: linear-gradient(135deg, var(--slp-orange-dark), var(--slp-orange));
}

.section-title::after {
  display: block;
  width: 52px;
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--slp-accent), var(--slp-orange), var(--slp-yellow));
  content: "";
}

@media (max-width: 900px) {
  .site-header {
    min-height: 72px;
  }

  .header-inner {
    position: relative;
    width: calc(100% - 30px);
    min-height: 72px;
  }

  .header-logo {
    max-width: 168px;
    max-height: 58px;
  }

  .menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    margin-left: auto;
    background: linear-gradient(135deg, var(--slp-accent), #0b6fca);
  }

  .header-navigation {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    margin: 0;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--slp-border);
    border-radius: 0 0 12px 12px;
    box-shadow: var(--slp-shadow);
  }

  body.navigation-open .header-navigation {
    display: block;
  }

  .header-navigation ul,
  .header-fallback-menu {
    display: block;
  }

  .header-navigation a {
    width: 100%;
  }

  .header-navigation .sub-menu {
    position: static;
    display: block;
    margin: 0 0 4px 14px;
    padding: 0 0 0 10px;
    border: 0;
    border-left: 2px solid var(--slp-border);
    border-radius: 0;
    box-shadow: none;
  }

  body.navigation-open .site-sidebar {
    transform: translateX(0);
  }

  .mobile-header {
    display: none;
  }
}

@media (max-width: 600px) {
  .header-inner {
    width: calc(100% - 20px);
  }

  .header-logo {
    max-width: 145px;
  }
}


/* Version 1.2: professional three-column Words101 layout */
.sidebar-logo-branding { display:flex; align-items:center; justify-content:center; min-height:120px; padding:10px 8px 24px; }
.sidebar-logo-branding a { display:block; line-height:0; }
.sidebar-logo { display:block; width:var(--slp-sidebar-logo-width); max-width:100%; max-height:150px; height:auto; object-fit:contain; object-position:center; }
.header-logo { width:var(--slp-header-logo-width); max-width:100%; max-height:66px; }
.page-layout { display:grid; grid-template-columns:minmax(0,1fr) var(--slp-ad-width); gap:28px; align-items:start; }
.primary-column { min-width:0; }
.ad-sidebar { position:sticky; top:calc(var(--slp-header-height) + 24px); }
.ad-sidebar-title { margin:0 0 10px; color:var(--slp-muted); font-size:.72rem; font-weight:800; letter-spacing:.1em; text-align:center; text-transform:uppercase; }
.ad-widget, .ad-placeholder { overflow:hidden; margin:0 0 20px; padding:14px; background:var(--slp-surface); border:1px solid var(--slp-border); border-radius:var(--slp-radius); box-shadow:var(--slp-shadow); }
.ad-widget img { display:block; width:100%; border-radius:9px; }
.ad-placeholder { display:flex; flex-direction:column; justify-content:center; min-height:250px; text-align:center; background:linear-gradient(145deg,#fff,#f7faff); border-style:dashed; }
.ad-placeholder span { color:var(--slp-accent); font-weight:800; }
.ad-placeholder small { margin-top:8px; color:var(--slp-muted); line-height:1.5; }
.site-header { border-top:3px solid var(--slp-orange); }
.site-header::after { content:""; display:block; height:3px; background:linear-gradient(90deg,var(--slp-accent) 0 52%,var(--slp-orange) 52% 78%,var(--slp-yellow) 78% 91%,var(--slp-red) 91%); }
.entry-card,.page-header,.hero { transition:box-shadow .2s ease,transform .2s ease; }
.entry-card:hover { box-shadow:0 16px 38px rgba(7,84,166,.12); }
.entry-title,.page-title,.hero-title { color:var(--slp-text); }
.entry-content a { color:var(--slp-accent); text-decoration:underline; text-decoration-color:rgba(7,84,166,.28); text-underline-offset:3px; }
.entry-content blockquote { margin:24px 0; padding:18px 22px; border-left:5px solid var(--slp-orange); background:#fff8f2; border-radius:0 10px 10px 0; }
.entry-content table { width:100%; border-collapse:collapse; }
.entry-content th { background:var(--slp-accent); color:#fff; }
.entry-content th,.entry-content td { padding:12px; border:1px solid var(--slp-border); text-align:left; }
@media (max-width:1180px){.page-layout{grid-template-columns:minmax(0,1fr) 220px}.content-shell{width:min(1050px,calc(100% - 36px))}}
@media (max-width:980px){.page-layout{grid-template-columns:1fr}.ad-sidebar{position:static;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.ad-sidebar-title{grid-column:1/-1}.ad-widget,.ad-placeholder{margin:0}}
@media (max-width:900px){.header-navigation{display:none;position:absolute;top:100%;left:15px;right:15px;padding:12px;background:#fff;border:1px solid var(--slp-border);border-radius:12px;box-shadow:var(--slp-shadow)}body.sidebar-open .header-navigation{display:block}.header-navigation ul,.header-fallback-menu{display:block}.header-navigation a{width:100%}.header-inner{width:calc(100% - 30px)}.header-logo{max-height:54px}}
@media (max-width:600px){.ad-sidebar{grid-template-columns:1fr}.header-logo{width:min(var(--slp-header-logo-width),145px)}}


/* Version 1.3: larger customizable sidebar logo and centered header navigation */
.header-inner {
  position: relative;
  justify-content: center;
}
.header-navigation {
  margin: 0 auto;
}
.header-navigation > ul,
.header-fallback-menu {
  justify-content: center;
}
.header-brand,
.header-logo {
  display: none !important;
}
.sidebar-logo-branding a {
  width: 100%;
  display: flex;
  justify-content: center;
}
.sidebar-logo {
  width: min(var(--slp-sidebar-logo-width), 100%);
  max-height: 170px;
}
.menu-toggle {
  position: absolute;
  right: 0;
}
@media (max-width: 900px) {
  .header-navigation { margin: 0; }
  .header-navigation > ul,
  .header-fallback-menu { justify-content: flex-start; }
}


/* Version 1.4: keep the desktop header menu exactly centered */
@media (min-width: 901px) {
  .header-inner {
    width: 100%;
    max-width: none;
    padding: 0 32px;
    justify-content: center;
  }

  .header-navigation {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    margin: 0 !important;
    justify-content: center;
  }

  .header-navigation > ul,
  .header-fallback-menu {
    width: auto;
    margin-right: auto;
    margin-left: auto;
    justify-content: center;
  }
}


/* Version 1.5: header navigation removed; the left sidebar is the primary navigation */
.site-header,
.header-navigation,
.header-fallback-menu {
  display: none !important;
}

.ad-sidebar {
  top: 24px;
}

@media (min-width: 901px) {
  .mobile-header {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .mobile-header {
    border-top: 3px solid var(--slp-orange);
    box-shadow: 0 4px 18px rgba(7, 84, 166, .08);
  }
  .mobile-header::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg,var(--slp-accent) 0 52%,var(--slp-orange) 52% 78%,var(--slp-yellow) 78% 91%,var(--slp-red) 91%);
    content: "";
  }
}
