/* Document
 * ========================================================================== */

/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */

:where(html) {
  line-height: 1.15; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
  text-size-adjust: 100%; /* 2 */
}

/* Sections
 * ========================================================================== */

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Edge, Firefox, and Safari.
 */

:where(h1) {
  font-size: 2em;
  margin-block-end: 0.67em;
  margin-block-start: 0.67em;
}

/* Grouping content
 * ========================================================================== */

/**
 * Remove the margin on nested lists in Chrome, Edge, and Safari.
 */

:where(dl, ol, ul) :where(dl, ol, ul) {
  margin-block-end: 0;
  margin-block-start: 0;
}

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Correct the inheritance of border color in Firefox.
 */

:where(hr) {
  box-sizing: content-box; /* 1 */
  color: inherit; /* 2 */
  height: 0; /* 1 */
}

/* Text-level semantics
 * ========================================================================== */

/**
 * Add the correct text decoration in Safari.
 */

:where(abbr[title]) {
  text-decoration: underline;
  text-decoration: underline dotted;
}

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */

:where(b, strong) {
  font-weight: bolder;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

:where(code, kbd, pre, samp) {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/**
 * Add the correct font size in all browsers.
 */

:where(small) {
  font-size: 80%;
}

/* Tabular data
 * ========================================================================== */

/**
 * 1. Correct table border color in Chrome, Edge, and Safari.
 * 2. Remove text indentation from table contents in Chrome, Edge, and Safari.
 */

:where(table) {
  border-color: currentColor; /* 1 */
  text-indent: 0; /* 2 */
}

/* Forms
 * ========================================================================== */

/**
 * Remove the margin on controls in Safari.
 */

:where(button, input, select) {
  margin: 0;
}

/**
 * Remove the inheritance of text transform in Firefox.
 */

:where(button) {
  text-transform: none;
}

/**
 * Correct the inability to style buttons in iOS and Safari.
 */

:where(button, input:is([type="button" i], [type="reset" i], [type="submit" i])) {
  -webkit-appearance: button;
}

/**
 * Add the correct vertical alignment in Chrome, Edge, and Firefox.
 */

:where(progress) {
  vertical-align: baseline;
}

/**
 * Remove the inheritance of text transform in Firefox.
 */

:where(select) {
  text-transform: none;
}

/**
 * Remove the margin in Firefox and Safari.
 */

:where(textarea) {
  margin: 0;
}

/**
 * 1. Correct the odd appearance in Chrome, Edge, and Safari.
 * 2. Correct the outline style in Safari.
 */

:where(input[type="search" i]) {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/**
 * Correct the cursor style of increment and decrement buttons in Safari.
 */

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/**
 * Correct the text style of placeholders in Chrome, Edge, and Safari.
 */

::-webkit-input-placeholder {
  color: inherit;
  opacity: 0.54;
}

/**
 * Remove the inner padding in Chrome, Edge, and Safari on macOS.
 */

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/**
 * 1. Correct the inability to style upload buttons in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/**
 * Remove the inner border and padding of focus outlines in Firefox.
 */

:where(button, input:is([type="button" i], [type="color" i], [type="reset" i], [type="submit" i]))::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/**
 * Restore the focus outline styles unset by the previous rule in Firefox.
 */

:where(button, input:is([type="button" i], [type="color" i], [type="reset" i], [type="submit" i]))::-moz-focusring {
  outline: 1px dotted ButtonText;
}

/**
 * Remove the additional :invalid styles in Firefox.
 */

:where(:-moz-ui-invalid) {
  box-shadow: none;
}

/* Interactive
 * ========================================================================== */

/*
 * Add the correct styles in Safari.
 */

:where(dialog) {
  background-color: white;
  border: solid;
  color: black;
  height: -moz-fit-content;
  height: fit-content;
  left: 0;
  margin: auto;
  padding: 1em;
  position: absolute;
  right: 0;
  width: -moz-fit-content;
  width: fit-content;
}

:where(dialog:not([open])) {
  display: none;
}

/*
 * Add the correct display in all browsers.
 */

:where(summary) {
  display: list-item;
}




.hebrew {
    font-family: 'Noto Sans Hebrew', 'Arial Unicode MS', Arial, sans-serif;
    direction: rtl;
    letter-spacing: 0.05em;
}

body {
    background: repeating-linear-gradient(135deg, #f0f0f0, #e8e8e8 10px, #f0f0f0 20px),
                url('https://www.transparenttextures.com/patterns/diamond-upholstery.png');
    font-family: 'Arial', 'Times New Roman', serif;
    color: #333;
    margin: 0;
}

.container, main {
    max-width: 850px;
    margin: 40px auto;
    background-color: #fff;
    border: 4px double #333;
    padding: 2.5em 3em;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    border-radius: 18px;
    min-height: 60vh;
}

h1, h2 {
    font-family: 'Times New Roman', serif;
    color: #0056b3;
    text-shadow: 1px 1px 0 #fff, 2px 2px 0 #ccc;
    border-bottom: 2px solid #0056b3;
    padding-bottom: 0.2em;
    margin-bottom: 1em;
    letter-spacing: 1px;
}

h3 {
  font-family: 'Times New Roman', serif;
  color: #7a3e00;
  text-shadow: none;
  border-bottom: 1px solid #dfdfdf;
  padding-bottom: 0.15em;
  margin-bottom: 0.8em;
  letter-spacing: 0;
}

a {
    color: #b30000;
    text-decoration: none;
    border-bottom: 2px dotted #b30000;
    transition: border-bottom 0.2s, color 0.2s;
    font-weight: bold;
}

a:hover {
  color: #0056b3;
  border-bottom: 2px solid #0056b3;
  background: linear-gradient(90deg, #ffe0e0 0%, #e0eaff 100%);
}


nav {
    background: linear-gradient(180deg, #f8f8f8 0%, #e4e4e4 100%);
    border: 2px solid #bfc7ce;
    border-radius: 7px 7px 0 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 1px 0 #fff inset;
    margin: 0;
    padding: 0;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
    position: relative;
    z-index: 10;
}
nav ul {
    list-style: none;
    margin: 0;
    padding: 0 0.5em;
    display: flex;
  flex-wrap: wrap;
    gap: 0.5em;
    justify-content: center;
    align-items: stretch;
    min-width: 0;
}
nav li {
    display: flex;
    align-items: stretch;
    margin: 0;
    padding: 0;
  flex: 0 0 auto;
}
nav a {
    display: flex;
    align-items: center;
  justify-content: center;
  padding: 0.38em 1.1em;
    margin: 0.15em 0.2em;
  background: #2f2a24;
  border: 2px solid;
  border-color: #dfdfdf #1d1a16 #1d1a16 #dfdfdf;
  border-radius: 0;
  color: #f3d36b;
  font-family: 'MS Sans Serif', 'Microsoft Sans Serif', Arial, sans-serif;
  font-size: 1.02em;
  font-weight: 700;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #1d1a16;
  text-shadow: none;
    text-decoration: none;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    min-width: 0;
  min-height: 38px;
  line-height: 1;
}
nav a:hover, nav a:focus {
  background: #3b352e;
  color: #ffd86a;
  border-color: #dfdfdf #1d1a16 #1d1a16 #dfdfdf;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #1d1a16;
    outline: none;
}
.rss-link {
  gap: 0.35rem;
}
.rss-link svg {
  margin-left: 0;
    vertical-align: middle;
    filter: drop-shadow(0 0 2px #bfc7ce);
  flex: 0 0 auto;
}
.rss-link:hover svg {
    filter: drop-shadow(0 0 6px #ff6600);
}

@media (max-width: 900px) {
  nav ul {
    justify-content: flex-start;
    gap: 0.35em;
    padding: 0.35em;
  }

  nav a {
    padding: 0.32em 0.72em;
    font-size: 0.97em;
    margin: 0.12em;
  }
}

ul {
    padding-left: 1em;
}

li {
    margin-bottom: 0.5em;
}

/* Poema: make poem pages responsive and allow them to expand wider than the default container
   - On wide screens the poem card can grow up to 1200px while keeping comfortable side padding
   - On narrow screens the poem card uses almost full viewport width
   - Ensure poem text is single-column and images scale responsively
*/
.poema-individual,
.container.poema-individual {
  max-width: 1200px;
  width: calc(100% - 4rem);
  margin: 24px auto;
  padding: 2.5em 2rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  border: none; /* override the global .container border for poem cards */
}

.poema-text {
  /* force single column reading flow and responsive typography */
  column-count: 1 !important;
  column-gap: normal !important;
  font-size: clamp(1rem, 1rem + 0.6vw, 1.25rem);
  line-height: 1.7;
}

.poema-text img,
.poema-text video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.2em auto;
}

/* Poemas index: use CSS Grid with responsive columns that fit screen size */
.poemas-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: start;
  width: 100%;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .poemas-list {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .poemas-list {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
  }
}

@media (min-width: 1400px) {
  .poemas-list {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
  }
}

.poema-card {
  background:#f7f7f7;
  border-radius:18px;
  box-shadow:0 2px 12px rgba(0,0,0,0.08);
  padding:1.25em 1.5em;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.poema-card:hover {
  transform: translateY(-6px);
  box-shadow:0 10px 30px rgba(0,0,0,0.12);
}

.poema-link {
  font-size:1.2em;
  font-weight:bold;
  color:#0056b3;
  text-decoration:none;
  margin-bottom:0.5em;
  border-bottom: 2px dotted #0056b3;
  transition: border-color 0.2s, color 0.2s;
}
.poema-link:hover {
  color: #b30000;
  border-bottom-color: #b30000;
}

.poema-year {
  color:#888;
  font-size:0.95em;
  margin-bottom:0.7em;
}

.poema-excerpt {
  color:#444;
  font-size:1em;
  font-style:italic;
  white-space:pre-line;
}
.poema-link {
  font-size:1.2em;
  font-weight:bold;
  color:#0056b3;
  text-decoration:none;
  margin-bottom:0.5em;
  border-bottom: 2px dotted #0056b3;
  transition: border-color 0.2s;
}
.poema-link:hover {
  border-bottom-color: #b30000;
}
.poema-year {
  color:#888;
  font-size:0.95em;
  margin-bottom:0.7em;
}
.poema-excerpt {
  color:#444;
  font-size:1em;
  font-style:italic;
  white-space:pre-line;
}

/* make the poem reference image larger on wide screens and responsive */
.poema-ref-img {
  max-width: 90%;
  height: auto;
  border-radius:12px;
  box-shadow:0 2px 12px rgba(0,0,0,0.12);
  display:block;
  margin:1.2em auto;
}
@media (min-width: 900px) {
  .poema-ref-img { max-width: 60%; }
}

@media (max-width: 900px) {
  .poema-individual,
  .container.poema-individual {
    width: calc(100% - 1.5rem);
    margin: 12px auto;
    padding: 1.2rem;
    border-radius: 12px;
  }
  .poema-text {
    font-size: 1.08em;
    line-height: 1.65;
  }
}

@media (min-width: 1600px) {
  .poema-individual,
  .container.poema-individual {
    width: 1400px;
  }
}

/* Overrides and accessibility helpers for poemas index */
/* Ensure exactly two columns on small screens to improve readability */
@media (max-width: 640px) {
  .poemas-list {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
  }
  .poema-card {
    padding: 0.8rem 0.9rem !important;
    border-radius: 12px !important;
  }
  .poema-link { font-size: 1.06rem !important; }
  .poema-excerpt { font-size: 1.02rem !important; line-height: 1.5 !important; }
}

/* Force two columns for narrow tablets and small desktops to avoid 3-column layout
   when the viewport is reduced (e.g. 700px-800px). This prevents three narrow
   columns from appearing on mid-size screens. */
@media (max-width: 800px) {
  .poemas-list {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.8rem !important;
  }
}

/* Off-screen searchable text: present in the DOM for browser search (Ctrl/Cmd+F)
   but removed from visual flow and made inert for layout. Use aria-hidden in templates if
   you want it ignored by assistive tech. */
.poema-search {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* Small tweak for high-DPI / narrow viewports to avoid very small type */
html, body { -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }

/* Fixes for very small screens where theme/vendor CSS may set fixed nav or hide overflow */
@media (max-width: 700px) {
  /* Ensure nav doesn't remain fixed and cover content */
  nav, .navbar { position: relative !important; top: auto !important; }
  .navbar-container { max-width: 100% !important; padding: 0.6rem 1rem !important; box-sizing: border-box !important; }

  /* Make main container fluid and avoid horizontal overflow */
  .container, main { max-width: 100% !important; margin: 0.6rem !important; padding: 1rem !important; box-sizing: border-box !important; }

  /* Allow the page to scroll; override any vendor overflow:hidden on small viewports */
  html, body { overflow-x: auto !important; }
}

/* === Site-wide palette sync (matching index) === */
:root {
  --pv-dark: #2f2a24;
  --pv-accent: #f3d36b;
  --pv-link: #7a3e00;
  --pv-link-hover: #a14f00;
  --pv-panel: #c0c0c0;
  --pv-border-hi: #dfdfdf;
  --pv-border-lo: #808080;
  --pv-card: #f7f7f7;
  --pv-text: #222;
  --pv-muted: #888;
}

body {
  color: var(--pv-text);
}

h1, h2, h3 {
  color: var(--pv-link);
  border-bottom-color: var(--pv-border-hi);
}

a {
  color: var(--pv-link);
  border-bottom-color: var(--pv-link);
}

a:hover {
  color: var(--pv-link-hover);
  border-bottom-color: var(--pv-link-hover);
}

.container,
main,
.poema-card,
.pelicula-card,
.experimento-card,
.ensayo-card,
.libro-card,
.latest-entry-card,
.pelicula-review,
.critica-text,
.resena-text {
  color: var(--pv-text);
}

.poema-link,
.pelicula-title,
.experimento-title,
.libro-title,
.ensayo-card h2,
.latest-entry-name,
.pelicula-title,
.container > h1 {
  color: var(--pv-link) !important;
  border-bottom-color: var(--pv-link);
}

.poema-year,
.pelicula-year,
.experimento-date,
.experimento-autor,
.ensayo-date,
.libro-date,
.fecha,
.meta,
.pelicula-watched,
.libro-autor,
.libro-autor-libro {
  color: var(--pv-muted) !important;
}

.poema-autor a,
.pelicula-autor a,
.experimento-autor a,
.resena-autor a,
.critica-autor a {
  color: var(--pv-link) !important;
}

/* Microlight + code block baseline styles */
pre {
  background: #1f1b17;
  color: #f2efe8;
  border: 2px solid;
  border-color: #dfdfdf #1d1a16 #1d1a16 #dfdfdf;
  border-radius: 6px;
  padding: 0.9em 1em;
  overflow-x: auto;
  line-height: 1.5;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

pre code {
  display: block;
  white-space: pre;
}

/* === Global button reactivity === */
.button,
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
nav a,
.next-button,
.rss-link,
.latest-entry-link,
.poema-link,
.pelicula-title,
.experimento-title,
.libro-title {
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
  will-change: transform;
}

.button:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
nav a:hover,
.next-button:hover,
.rss-link:hover,
.latest-entry-link:hover,
.poema-link:hover,
.pelicula-title:hover,
.experimento-title:hover,
.libro-title:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.button:active,
button:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active,
nav a:active,
.next-button:active,
.rss-link:active,
.latest-entry-link:active,
.poema-link:active,
.pelicula-title:active,
.experimento-title:active,
.libro-title:active {
  transform: translateY(1px) scale(0.995);
  filter: brightness(0.98);
}

.button:focus-visible,
button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible,
nav a:focus-visible,
.next-button:focus-visible,
.rss-link:focus-visible,
.latest-entry-link:focus-visible,
.poema-link:focus-visible,
.pelicula-title:focus-visible,
.experimento-title:focus-visible,
.libro-title:focus-visible {
  outline: 2px solid #f3d36b;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .button,
  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  nav a,
  .next-button,
  .rss-link,
  .latest-entry-link,
  .poema-link,
  .pelicula-title,
  .experimento-title,
  .libro-title {
    transition: none;
  }
}

