/*
Theme Name:  EAOSimple
Theme URI:   https://example.com
Author:      Eliezer Alvarez
Description: Minimal static-page theme. No blog, no posts. Gutenberg-compatible classic theme.
Version:     1.3.1
Text Domain: eaosimple
*/

/* ==========================================================================
   Custom Properties
   ========================================================================== */

:root {
  --color-text:        #1a1a1a;
  --color-muted:       #555555;
  --color-bg:          #ffffff;
  --color-border:      #e0e0e0;
  --color-accent:      #0066cc;
  --color-accent-dark: #004fa3;

  --font-body:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:  ui-monospace, SFMono-Regular, Menlo, "Courier New", monospace;

  --font-size-base: 1.0625rem; /* ~17px */
  --font-size-sm:   0.9375rem; /* ~15px */
  --font-size-lg:   1.25rem;
  --font-size-xl:   1.75rem;
  --font-size-2xl:  2.25rem;

  --line-height: 1.7;

  --max-width:        800px;
  --max-width-wide:   1100px;
  --gutter:           1.25rem;
  --spacing-section:  3rem;

  /* Surfaces used for code blocks and table headers.
     Defined as variables so the dark mode block can override them cleanly. */
  --color-code-bg:         #f4f4f4;
  --color-table-header-bg: #f9f9f9;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  margin-top: 1.75em;
  margin-bottom: 0.5em;
  line-height: 1.25;
  color: var(--color-text);
  font-weight: 600;
}

h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }
h4, h5, h6 { font-size: var(--font-size-base); }

p {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

ul,
ol {
  margin-top: 0;
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--color-border);
  color: var(--color-muted);
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  background: var(--color-code-bg);
  padding: 1rem 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

pre code {
  background: none;
  padding: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: var(--font-size-sm);
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: 600;
  background: var(--color-table-header-bg);
}

/* ==========================================================================
   Layout — centered single column
   ========================================================================== */

/* Shared inner wrapper used by header, main content, and footer */
.site-header-inner,
.page-content,
.not-found-content,
.site-footer-inner {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ==========================================================================
   Site Header
   ========================================================================== */

#site-header {
  border-bottom: 1px solid var(--color-border);
  padding-block: 1.25rem;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Site title / branding */
.site-branding a {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-branding a:hover {
  color: var(--color-accent);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

#site-navigation {
  /* flex child; no extra wrapper needed */
}

/* wp_nav_menu outputs a <ul> with class nav-menu */
ul.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

ul.nav-menu li {
  margin: 0;
}

ul.nav-menu a {
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}

ul.nav-menu a:hover,
ul.nav-menu .current-menu-item > a,
ul.nav-menu .current_page_item > a {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* Drop sub-menus from default output — we only register one level */
ul.nav-menu .sub-menu {
  display: none;
}

/* ==========================================================================
   Hamburger Toggle Button
   ========================================================================== */

/* Hidden on desktop; shown via the mobile media query below */
#menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--color-text);
}

#menu-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Animate bars into an X when the menu is open */
#menu-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#menu-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
}
#menu-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Main content area
   ========================================================================== */

#main {
  padding-block: var(--spacing-section);
}

/* ==========================================================================
   Page template
   ========================================================================== */

.page-content {
  /* max-width and centering inherited from shared rule above */
}

/* Page title (rendered by page.php) */
.page-title {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: var(--font-size-2xl);
}

/* Entry content — the block editor output */
.entry-content > *:first-child {
  margin-top: 0;
}

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

/* ==========================================================================
   Gutenberg Block Support
   ========================================================================== */

/* alignwide breaks out of the 800px column to ~1100px */
.entry-content .alignwide {
  max-width: var(--max-width-wide);
  margin-inline: calc(50% - var(--max-width-wide) / 2);
  width: var(--max-width-wide);
}

/* alignfull spans the full viewport width */
.entry-content .alignfull {
  max-width: 100vw;
  margin-inline: calc(50% - 50vw);
  width: 100vw;
}

/* alignleft / alignright */
.entry-content .alignleft {
  float: left;
  margin: 0.5rem 1.5rem 1rem 0;
}

.entry-content .alignright {
  float: right;
  margin: 0.5rem 0 1rem 1.5rem;
}

/* Responsive embeds wrapper (added by WordPress when responsive-embeds support is declared) */
.wp-block-embed__wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.wp-block-embed__wrapper iframe,
.wp-block-embed__wrapper object,
.wp-block-embed__wrapper embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Buttons block */
.wp-block-button__link {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.wp-block-button__link:hover {
  opacity: 0.85;
}

/* Separator block */
.wp-block-separator {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* Image block captions */
.wp-block-image figcaption,
.wp-block-gallery figcaption {
  font-size: var(--font-size-sm);
  color: var(--color-muted);
  margin-top: 0.4rem;
  text-align: center;
}

/* ==========================================================================
   Site Footer
   ========================================================================== */

#site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: 1.5rem;
  margin-top: var(--spacing-section);
}

.site-footer-inner {
  /* max-width and centering inherited from shared rule above */
}

.copyright {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-muted);
}

/* ==========================================================================
   404 Page
   ========================================================================== */

.not-found-content {
  padding-block: var(--spacing-section);
  text-align: center;
}

.not-found-content h1 {
  font-size: var(--font-size-2xl);
  margin-top: 0;
}

.not-found-content p {
  color: var(--color-muted);
}

.not-found-content .back-home {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.65rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.15s;
}

.not-found-content .back-home:hover {
  background: var(--color-accent-dark);
  color: #fff;
}

/* ==========================================================================
   Responsive — single breakpoint at 640px
   ========================================================================== */

@media (max-width: 640px) {
  :root {
    --font-size-base: 1rem;
    --font-size-2xl:  1.75rem;
    --font-size-xl:   1.4rem;
    --spacing-section: 2rem;
  }

  /* Header stays as a single row: branding left, hamburger button right.
     The nav wraps onto its own row below when opened. */
  .site-header-inner {
    gap: 0;
  }

  /* Show the hamburger button */
  #menu-toggle {
    display: flex;
  }

  /* Nav is hidden by default; toggled open via JS */
  #site-navigation {
    display: none;
    width: 100%;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
  }

  #site-navigation.is-open {
    display: block;
  }

  /* Nav links stack as a vertical list with separator lines */
  ul.nav-menu {
    flex-direction: column;
    gap: 0;
  }

  ul.nav-menu a {
    display: block;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--color-border);
  }

  ul.nav-menu a:hover,
  ul.nav-menu .current-menu-item > a,
  ul.nav-menu .current_page_item > a {
    border-bottom-color: var(--color-border); /* keep separator; color change is enough */
  }

  ul.nav-menu li:last-child > a {
    border-bottom: none;
  }

  /* Wide/full alignment fallback — don't overflow on narrow screens */
  .entry-content .alignwide,
  .entry-content .alignfull {
    max-width: 100%;
    width: 100%;
    margin-inline: 0;
  }

  .entry-content .alignleft,
  .entry-content .alignright {
    float: none;
    margin: 0 0 1rem 0;
  }
}

