/*
Theme Name: Teacher Manal
Theme URI: https://teachermanal.com
Author: Manal
Description: Custom theme for Teacher Manal — a calm, sage-green and terracotta themed platform for teacher resources, courses, books, and wellness content.
Version: 1.0
Requires PHP: 7.4
Text Domain: teacher-manal
*/

/* ============================================
   1. DESIGN TOKENS (colors, fonts, spacing)
   ============================================ */
:root {
  --color-bg: #FBF4E6;          /* warm cream background */
  --color-bg-alt: #FFFFFF;
  --color-sage: #4F6B4F;        /* main sage green (headings, logo) */
  --color-sage-dark: #3C523C;
  --color-terracotta: #C77B4F;  /* accent color */
  --color-text: #2B2A26;        /* near-black warm text */
  --color-text-muted: #6B6A63;
  --color-border: #E7DFCB;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-lg: 24px;
  --radius-md: 12px;
  --container-width: 1200px;
}

/* ============================================
   2. RESET / BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }

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

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 32px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.4em;
  color: var(--color-text);
}

/* ============================================
   3. HEADER / NAV
   ============================================ */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-logo-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-sage);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  flex-shrink: 0;
}

.site-logo-wrap {
  flex-shrink: 0;
}

.site-logo-wrap .custom-logo {
  height: 44px;
  width: auto;
  display: block;
}

.site-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
}

.site-tagline {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-icons button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  display: flex;
}

/* ============================================
   4. HERO SECTION
   ============================================ */
.hero {
  padding: 80px 0 100px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-sage);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-heading {
  font-size: 64px;
  line-height: 1.05;
  margin-bottom: 24px;
}

.hero-heading .accent {
  color: var(--color-sage);
}

.hero-subtext {
  font-size: 19px;
  color: var(--color-text-muted);
  max-width: 480px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--color-sage);
  color: #fff;
}

.btn-primary:hover { background: var(--color-sage-dark); }

.btn-secondary {
  background: transparent;
  border-color: var(--color-sage);
  color: var(--color-sage);
}

.hero-image-wrap {
  position: relative;
}

.hero-image-wrap img {
  border-radius: var(--radius-lg);
  transform: rotate(2deg);
  border: 6px solid #fff;
  box-shadow: 0 30px 60px rgba(43, 42, 38, 0.15);
}

.hero-badge {
  position: absolute;
  top: 24px;
  right: -12px;
  background: #fff;
  padding: 10px 18px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(43, 42, 38, 0.12);
}

/* ---- Primary nav ---- */
.primary-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-menu li {
  position: relative;
}

.primary-menu a {
  font-size: 15px;
  font-weight: 600;
}

.primary-menu a:hover { color: var(--color-sage); }

/* Dropdown for items with children, e.g. "Digital Resources" */
.primary-menu ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 0;
  min-width: 220px;
  box-shadow: 0 20px 40px rgba(43, 42, 38, 0.1);
  list-style: none;
  z-index: 20;
}

.primary-menu li:hover > ul {
  display: block;
}

.primary-menu ul li a {
  display: block;
  padding: 8px 20px;
  font-weight: 500;
  white-space: nowrap;
}

.primary-menu ul li a:hover {
  background: var(--color-bg);
}

@media (max-width: 860px) {
  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 20px 32px;
  }

  .primary-nav.is-open { display: block; }

  .primary-menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .primary-menu ul {
    position: static;
    border: none;
    box-shadow: none;
    padding-left: 16px;
    display: block; /* always expanded on mobile, no hover available */
  }

  .site-header-inner { position: relative; }
}

/* ============================================
   5. CATEGORY TILES
   ============================================ */
.category-tiles {
  padding: 40px 0 80px;
}

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.category-tile {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(43, 42, 38, 0.08);
}

.category-tile-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 12px;
}

.category-tile h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.category-tile p {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0;
}

/* ============================================
   6. FEATURED RESOURCES
   ============================================ */
.featured-resources {
  padding: 40px 0 80px;
}

.section-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-heading-row h2 {
  margin: 0;
}

.section-link {
  color: var(--color-sage);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}

.resource-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.resource-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(43, 42, 38, 0.08);
}

.resource-card-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.resource-card-body {
  padding: 18px 20px 22px;
}

.resource-card-badge {
  display: inline-block;
  background: var(--color-bg);
  color: var(--color-sage);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 10px;
}

.resource-card h3 {
  font-size: 18px;
  margin: 0;
}

/* ============================================
   7. ABOUT PREVIEW
   ============================================ */
.about-preview {
  padding: 60px 0;
  background: #fff;
}

.about-preview-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 60px;
  align-items: center;
}

.about-preview-image img {
  width: 100%;
  height: 260px;
  border-radius: 20px;
  object-fit: cover;
}

/* ============================================
   8. NEWSLETTER / CTA
   ============================================ */
.newsletter-cta {
  padding: 80px 0;
  text-align: center;
}

.newsletter-inner {
  max-width: 560px;
}

.newsletter-inner p {
  color: var(--color-text-muted);
  margin-bottom: 28px;
}

.newsletter-form {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.newsletter-form input[type="email"] {
  flex: 1;
  max-width: 320px;
  padding: 14px 20px;
  border-radius: 100px;
  border: 1px solid var(--color-border);
  font-size: 15px;
  font-family: var(--font-body);
}

.newsletter-form input[type="email"]:focus {
  outline: 2px solid var(--color-sage);
}

.newsletter-form button {
  border: none;
}

/* ============================================
   10. GENERIC PAGES (About / Contact / FAQ)
   ============================================ */
.page-hero {
  padding: 60px 0 20px;
  background: #fff;
}

.page-content .entry-content h2 {
  margin-top: 48px;
}

/* ---- About page: side-by-side intro ---- */
.about-intro-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.about-intro-image {
  order: 2;
}

.about-intro-image img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  border-radius: 20px;
}

@media (max-width: 780px) {
  .about-intro-grid {
    grid-template-columns: 1fr;
  }
  .about-intro-image {
    order: 1;
  }
}

.about-content p {
  color: var(--color-text-muted);
}

/* ---- Philosophy section: text + checklist card ---- */
.about-philosophy {
  padding: 80px 0;
}

.about-philosophy-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: start;
}

.about-philosophy-text p {
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.about-guides-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px;
}

.about-guides-card h3 {
  font-size: 19px;
  margin-bottom: 20px;
}

.about-guides-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.about-guides-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 14px;
  color: var(--color-text-muted);
  font-size: 15px;
}

.about-guides-list li:last-child { margin-bottom: 0; }

.about-guides-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-sage);
  font-weight: 700;
}

/* ---- Three role cards ---- */
.about-roles {
  padding: 20px 0 80px;
}

.about-roles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.about-role-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
}

.about-role-icon {
  font-size: 26px;
  display: block;
  margin-bottom: 14px;
}

.about-role-card h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.about-role-card p {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0;
}

@media (max-width: 780px) {
  .about-philosophy-grid { grid-template-columns: 1fr; }
  .about-roles-grid { grid-template-columns: 1fr; }
}

/* ---- Contact form ---- */
.contact-form {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-top: 20px;
}

.form-row {
  margin-bottom: 20px;
}

.form-row label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--color-bg);
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: 2px solid var(--color-sage);
}

.contact-form button {
  width: 100%;
}

/* ---- FAQ accordion (native <details>/<summary>, no JS needed) ---- */
.faq-page details {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 14px;
}

.faq-page summary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-page summary::-webkit-details-marker { display: none; }

.faq-page summary::after {
  content: '+';
  font-size: 22px;
  color: var(--color-sage);
  margin-left: 16px;
}

.faq-page details[open] summary::after {
  content: '−';
}

.faq-page details p {
  color: var(--color-text-muted);
  margin-top: 14px;
  margin-bottom: 0;
}

/* ============================================
   11. RESPONSIVE
   ============================================ */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-heading { font-size: 42px; }
  .site-header-inner { padding: 16px 20px; }
  .tiles-grid { grid-template-columns: repeat(2, 1fr); }
  .resource-cards-grid { grid-template-columns: 1fr; }
  .about-preview-grid { grid-template-columns: 1fr; text-align: center; }
  .about-preview-image { max-width: 100% !important; }
  .about-preview-image img { height: 200px; }
  .newsletter-form { flex-direction: column; align-items: center; }
  .newsletter-form input[type="email"] { max-width: 100%; }
}

/* ============================================
   6. FOOTER
   ============================================ */

/* ---- Newsletter band ---- */
.site-newsletter {
  padding: 0 24px;
  margin: 60px 0 0;
}

.site-newsletter-inner {
  background: var(--color-sage-dark);
  border-radius: var(--radius-lg);
  padding: 48px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
}

.site-newsletter-text .hero-eyebrow {
  color: #d9e2d3;
}

.site-newsletter-text h2 {
  color: #fff;
  font-size: 32px;
  margin-bottom: 10px;
}

.site-newsletter-text p:last-child {
  color: #d9e2d3;
  margin: 0;
}

.site-newsletter-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.site-newsletter-fields label {
  display: block;
  color: #d9e2d3;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.site-newsletter-fields input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 100px;
  border: none;
  font-family: var(--font-body);
  font-size: 15px;
}

.site-newsletter-submit {
  width: 100%;
  border: none;
  background: var(--color-terracotta);
}

.site-newsletter-note {
  color: #a9bba4;
  font-size: 12px;
  margin: 10px 0 0;
}

@media (max-width: 780px) {
  .site-newsletter-inner { grid-template-columns: 1fr; padding: 32px 24px; }
  .site-newsletter-fields { grid-template-columns: 1fr; }
}

/* ---- MC4WP newsletter form: restyle to match the site design ---- */
/* Beginner note: MC4WP renders plain, unstyled HTML by default — these
   rules target its actual output structure so it matches the rest of
   the newsletter band instead of looking like a bare browser form. */
.site-newsletter-form .mc4wp-form-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.site-newsletter-form .mc4wp-form-fields label {
  display: block;
  color: #d9e2d3;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.site-newsletter-form .mc4wp-form-fields input[type="email"],
.site-newsletter-form .mc4wp-form-fields input[type="text"] {
  padding: 12px 16px;
  border-radius: 100px;
  border: none;
  font-family: var(--font-body);
  font-size: 15px;
  min-width: 220px;
}

.site-newsletter-form .mc4wp-form-fields input[type="submit"] {
  padding: 12px 28px;
  border-radius: 100px;
  border: none;
  background: var(--color-terracotta);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

.site-newsletter-form .mc4wp-form-fields input[type="submit"]:hover {
  background: #a8623c; /* slightly darker terracotta on hover */
}

@media (max-width: 780px) {
  .site-newsletter-form .mc4wp-form-fields {
    flex-direction: column;
    align-items: stretch;
  }
  .site-newsletter-form .mc4wp-form-fields input {
    min-width: 0;
    width: 100%;
  }
}

/* ---- Footer columns ---- */
.site-footer {
  background: #fff;
  color: var(--color-text);
  padding: 60px 0 0;
  margin-top: 40px;
  border-top: 1px solid var(--color-border);
}

.footer-columns {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}

.footer-brand .site-branding .site-title,
.footer-brand .site-branding .site-tagline {
  color: var(--color-text) !important;
}

.footer-brand-desc {
  color: var(--color-text-muted);
  font-size: 14px;
  margin-top: 16px;
  max-width: 280px;
}

.footer-col h4 {
  font-size: 15px;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  color: var(--color-text-muted);
  font-size: 14px;
}

.footer-col a:hover {
  color: var(--color-sage);
}

/* ---- Footer social links ---- */
.footer-social a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-muted);
}

.footer-social a:hover {
  color: var(--color-sage);
}

.footer-social svg {
  flex-shrink: 0;
  color: var(--color-sage);
}

.footer-social a:hover svg {
  color: var(--color-sage-dark);
}

/* ---- Footer bottom bar ---- */
.site-footer .footer-bottom {
  padding: 24px 0;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text-muted);
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-bottom-inner p {
  margin: 0;
}

.footer-legal {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-legal a {
  color: var(--color-text-muted);
}

.footer-legal a:hover {
  color: var(--color-sage);
}

/* ---- Newsletter fallback form (when MC4WP inactive) ---- */
.site-newsletter-form {
  min-width: 0;
}

.site-newsletter-fallback .site-newsletter-fields {
  margin-bottom: 16px;
}

.site-newsletter-fallback .btn {
  border: none;
}

@media (max-width: 860px) {
  .footer-columns { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-columns { grid-template-columns: 1fr; }
}

/* ---- Blog card grid ---- */
.blog-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.blog-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(43, 42, 38, 0.08);
}

.blog-card-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.blog-card-body {
  padding: 20px 22px 24px;
}

.blog-card-date {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-sage);
  margin-bottom: 8px;
}

.blog-card h2 {
  font-size: 19px;
  margin-bottom: 10px;
}

.blog-card-excerpt {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.blog-card-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-sage);
}

@media (max-width: 860px) {
  .blog-cards-grid { grid-template-columns: 1fr; }
}

/* ============================================
   12. WOOCOMMERCE — basic reskin to match site palette
   ============================================ */
.woocommerce ul.products li.product {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.woocommerce ul.products li.product img {
  border-radius: 10px;
}

.woocommerce ul.products li.product .price {
  color: var(--color-terracotta);
  font-weight: 700;
}

.woocommerce a.button,
.woocommerce button.button,
.woocommerce #respond input#submit,
.woocommerce input.button,
.woocommerce .single_add_to_cart_button {
  background: var(--color-sage) !important;
  color: #fff !important;
  border-radius: 100px !important;
  border: none !important;
  font-family: var(--font-body) !important;
  font-weight: 600 !important;
  padding: 12px 24px !important;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce .single_add_to_cart_button:hover {
  background: var(--color-sage-dark) !important;
}

.woocommerce span.onsale {
  background: var(--color-terracotta) !important;
  border-radius: 100px;
}

.woocommerce-message,
.woocommerce-info {
  border-top-color: var(--color-sage) !important;
}

.woocommerce-message::before,
.woocommerce-info::before {
  color: var(--color-sage) !important;
}
