/*
Theme Name: GeneratePress Child — Estudantices
Template: generatepress
Version: 1.0.0
Description: Child theme for Estudantices education platform
Author: ThinxLabs
*/

/* === Estudantices Design System === */

/* 1. Override GP color palette */
:root {
  --est-primary: #7AA6C6;
  --est-beige: #F5EDE0;
  --est-muted: #7B6B5A;
  --est-text: #4A3728;
  --est-border: #E8DCC8;
  --est-bg: #FDFCFA;

  /* Map GP tokens to Estudantices palette */
  --accent: var(--est-primary);
  --contrast: var(--est-text);
  --contrast-2: var(--est-muted);
  --base: var(--est-border);
  --base-2: var(--est-beige);
  --base-3: var(--est-white, #FFFFFF);
}

/* 2. Typography */
body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  font-size: 15px;
  background: var(--est-bg);
  color: var(--est-muted);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--est-text);
  font-weight: 700;
}

/* 3. Header — full width */
.site-header {
  background: var(--est-beige);
  border-bottom: 1px solid var(--est-border);
}

.inside-header {
  padding: 12px 48px;
}

/* Header wrapper — full width on custom pages */
.home .site-header .inside-header,
.post-type-archive-recurso .site-header .inside-header,
.single-recurso .site-header .inside-header,
.page-template-page-sobre .site-header .inside-header,
.page-template-page-exames .site-header .inside-header {
  max-width: none;
}

/* Logo — E in Kalam, "studantices" in Nunito (text logo) */
.est-text-logo a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Hide old image logo and site title text */
.site-logo {
  display: none !important;
}

.site-branding-container .site-branding {
  display: none !important;
}

/* 4. Navigation */
.main-navigation,
.main-navigation ul ul {
  background: transparent;
}

.main-navigation .main-nav ul li a {
  color: var(--est-muted);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 12px;
}

.main-navigation .main-nav ul li:hover > a,
.main-navigation .main-nav ul li:focus > a,
.main-navigation .main-nav ul li.sfHover > a {
  color: var(--est-primary);
}

.main-navigation .main-nav ul li[class*="current-menu-"] > a {
  color: var(--est-primary);
}

/* 5. Content area */
.separate-containers .inside-article {
  background: transparent;
  padding: 0;
}

/* 6. Buttons */
button, 
.button, 
.wp-block-button__link {
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.15s ease;
}

button:hover, 
.button:hover {
  opacity: 0.9;
}

/* 7. Cards & widgets */
.sidebar .widget {
  background: var(--est-white, #FFFFFF);
  border: 1px solid var(--est-border);
  border-radius: 12px;
  padding: 24px;
}

/* 8. Footer */

/* 9. Full-width pages — homepage, recursos, exames, sobre, single recurso */
.home,
.post-type-archive-recurso,
.single-recurso,
.page-template-page-sobre,
.page-template-page-exames {
  --gp-container-width: 100%;
}

.home .site,
.post-type-archive-recurso .site,
.single-recurso .site,
.page-template-page-sobre .site,
.page-template-page-exames .site {
  max-width: 100%;
  padding: 0 !important;
  margin-top: 0 !important;
}

.home .site .grid-container,
.post-type-archive-recurso .site .grid-container,
.single-recurso .site .grid-container,
.page-template-page-sobre .site .grid-container,
.page-template-page-exames .site .grid-container {
  max-width: 100% !important;
  padding: 0 !important;
}

.home .site-content {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
}

.home .content-area,
.home .site-main,
.home #primary,
.home #main {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

.home .inside-article {
  padding: 0 !important;
  margin: 0 !important;
}

.home .entry-content {
  padding: 0 !important;
  margin: 0 !important;
}

/* Hide sidebar on front page */
.home .widget-area,
.home .is-right-sidebar {
  display: none !important;
}

/* Hide page title on front page */
.home .entry-header {
  display: none !important;
}

/* 10. GenerateBlocks overrides */
.gb-container .gb-headline {
  margin-bottom: 0;
}

/* Year grid cards */
.gb-grid-wrapper > .gb-grid-column {
  min-width: 0;
}

/* 11. Responsive — Tablet (≤900px) */
@media (max-width: 900px) {
  .inside-header {
    padding: 12px 24px;
  }

  /* Hero: 2-col → 1-col */
  div[style*="grid-template-columns: 1fr 1fr"][style*="padding:64px 48px"] {
    grid-template-columns: 1fr !important;
    padding: 40px 24px !important;
  }

  /* Year grid + Features: 4-col → 2-col */
  div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
}

/* 12. Responsive — Mobile (≤600px) */
@media (max-width: 600px) {
  .inside-header {
    padding: 10px 16px;
    flex-direction: column;
    gap: 8px;
  }

  .site-logo .custom-logo-link img {
    max-height: 30px;
  }

  /* Hero: full width stack */
  div[style*="grid-template-columns: 1fr 1fr"][style*="padding:64px 48px"] {
    grid-template-columns: 1fr !important;
    padding: 32px 16px !important;
    gap: 24px !important;
  }

  div[style*="grid-template-columns: 1fr 1fr"] h1 {
    font-size: 28px !important;
  }

  /* Year + Features: 4-col → 1-col */
  div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  div[style*="padding:24px 48px 48px"] {
    padding: 16px 16px 32px !important;
  }

  /* Make tables scrollable */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* 13. Accessibility */
/* Focus ring */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--est-primary);
  outline-offset: 2px;
}

/* Skip link — follows GP pattern but visible on focus */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--est-primary);
  color: #FFFFFF;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 14. Print-optimized CSS for worksheets */
@media print {
  .site-header,
  .site-footer,
  .sidebar,
  .est-sidebar,
  .est-filters,
  .navigation,
  .skip-link,
  button:not(.no-print),
  .gb-container[style*="position: sticky"] {
    display: none !important;
  }

  body {
    background: #FFFFFF;
    color: #000000;
    font-size: 12pt;
  }

  #primary {
    width: 100% !important;
  }

  .inside-article {
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }

  a {
    color: #000000;
    text-decoration: underline;
  }

  h1, h2, h3, h4, h5, h6 {
    color: #000000;
    page-break-after: avoid;
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  p, li, blockquote {
    orphans: 3;
    widows: 3;
  }

  table {
    border-collapse: collapse;
    width: 100%;
  }

  th, td {
    border: 1px solid #ccc;
    padding: 8px;
  }

  @page {
    margin: 2cm;
  }
}
.page-template-page-sobre .inside-article { padding-bottom: 0 !important; }
.site-footer, .footer-widgets { display: none !important; }

/* === Estudar com IA page === */
.page-template-page-estudar-com-ia .site-header .inside-header {
  max-width: none;
}
.page-template-page-estudar-com-ia {
  --gp-container-width: 100%;
}
.page-template-page-estudar-com-ia .site {
  max-width: 100%;
  padding: 0 !important;
  margin-top: 0 !important;
}
.page-template-page-estudar-com-ia .site .grid-container {
  max-width: 100% !important;
  padding: 0 !important;
}
.page-template-page-estudar-com-ia .site-content {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
}
.page-template-page-estudar-com-ia .content-area,
.page-template-page-estudar-com-ia .site-main,
.page-template-page-estudar-com-ia #primary,
.page-template-page-estudar-com-ia #main {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}
.page-template-page-estudar-com-ia .inside-article {
  padding: 0 !important;
  margin: 0 !important;
}
.page-template-page-estudar-com-ia .entry-content {
  padding: 0 !important;
  margin: 0 !important;
}
.page-template-page-estudar-com-ia .widget-area,
.page-template-page-estudar-com-ia .is-right-sidebar {
  display: none !important;
}
.page-template-page-estudar-com-ia .entry-header {
  display: none !important;
}
.page-template-page-estudar-com-ia .inside-article {
  padding-bottom: 0 !important;
}

/* Homepage year box hover */
.home a[href^="/recursos/?ano="] { transition: border-color 0.2s, box-shadow 0.2s; }
.home a[href^="/recursos/?ano="]:hover { border-color: #7AA6C6 !important; box-shadow: 0 2px 8px rgba(122,166,198,0.2); }
/* Homepage feature box hover */
.home a[href^="/recursos/?tipo="] { transition: border-color 0.2s, box-shadow 0.2s; border: 1px solid transparent; }
.home a[href^="/recursos/?tipo="]:hover { border-color: #7AA6C6 !important; box-shadow: 0 2px 8px rgba(122,166,198,0.15); }
