/* ==========================================================================
   I Love E-Poetry — Red & White Theme
   Color Palette:
     Primary (red):       #D9342A
     Background:          #FFFFFF
     Text:                #000000
     Light accent:        #FFF0F0
   Contrast rules:
     Red background → white text, white links (even visited)
     White background → black text, red links (even visited)
   ========================================================================== */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: Georgia, "Times New Roman", Times, serif;
  color: #000;
  background: #fff;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, "Times New Roman", Times, serif;
  color: #000;
  line-height: 1.3;
  margin-bottom: 0.5em;
}

a {
  color: #D9342A;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:visited {
  color: #D9342A;
}

a:hover {
  color: #D9342A;
  text-decoration: underline;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Container --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Site Content --- */
.site-content {
  flex: 1;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  background: #fff;
  color: #000;
  padding: 0.6rem 0 0;
  border-bottom: 2px solid #eee;
  position: relative;
  z-index: 1000;
}

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

.header-brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.site-title {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.02em;
}

.site-title:visited,
.site-title:hover {
  color: #000;
  text-decoration: none;
}

.site-title .heart {
  color: #D9342A;
  font-size: 1.2em;
}

.site-description {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-search {
  position: relative;
  width: 220px;
}

/* --- Language Switcher --- */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lang-option,
.lang-option:visited {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  color: #888;
  transition: background 0.2s, color 0.2s;
}

.lang-option:hover {
  color: #222;
  background: #f0f0f0;
  text-decoration: none;
}

.lang-option.active {
  background: #D9342A;
  color: #fff;
  border-radius: 3px;
}

.lang-divider {
  color: #ccc;
  user-select: none;
}

/* --- Hamburger --- */
.hamburger-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: #222;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* --- Navigation --- */
.site-nav {
  margin-top: 0.75rem;
  border-top: 1px solid #eee;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 0;
  padding: 0;
  margin: 0;
}

.nav-list li a,
.nav-list li a:visited {
  display: block;
  padding: 0.7rem 1rem;
  color: #000;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.nav-list li a:hover {
  background: #f5f5f5;
  color: #D9342A;
  text-decoration: none;
}

/* ==========================================================================
   Post Header Bar
   ========================================================================== */
.post-header-bar {
  background: #D9342A;
  color: #fff;
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.post-header-bar .post-title {
  color: #fff;
  font-size: 2rem;
  margin-bottom: 0.3rem;
}

.post-header-bar .post-date {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}

/* ==========================================================================
   Post Body
   ========================================================================== */
.post-body {
  padding: 1rem 0 3rem;
}

.post-featured-image {
  max-width: 400px;
  margin: 0 auto 2rem;
  border-radius: 4px;
  overflow: hidden;
}

.post-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.post-content {
  max-width: 780px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.8;
}

.post-content p {
  margin-bottom: 1.25em;
}

.post-content h2 {
  margin-top: 2em;
}

.post-content h3 {
  margin-top: 1.5em;
}

.post-content blockquote {
  border-left: 4px solid #D9342A;
  margin: 1.5em 0;
  padding: 0.75em 1.25em;
  background: #FFF0F0;
  font-style: italic;
  color: #333;
}

.post-content pre {
  background: #333;
  color: #fff;
  padding: 1rem 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5em 0;
}

.post-content code {
  font-size: 0.9em;
}

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5em auto;
  border-radius: 4px;
}

/* --- Post Actions Row --- */
.post-actions-row {
  max-width: 780px;
  margin: 2rem auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  text-align: center;
}

.post-action-btn {
  display: inline-block;
  padding: 0.85rem 2.5rem;
  background: #D9342A;
  color: #fff !important;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 6px;
  text-decoration: none !important;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.15s;
}

.post-action-btn:visited {
  color: #fff !important;
}

.post-action-btn:hover {
  background: #b82b22;
  color: #fff !important;
  transform: translateY(-2px);
  text-decoration: none !important;
}

/* --- Post Metadata Box --- */
.post-metadata-box {
  max-width: 780px;
  margin: 2rem auto;
  background: #D9342A;
  color: #fff;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
}

.post-metadata-box a,
.post-metadata-box a:visited,
.post-metadata-box a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-metadata-box a:hover {
  opacity: 0.85;
}

.metadata-section {
  margin-bottom: 0.6rem;
  line-height: 1.6;
  font-size: 0.92rem;
}

.metadata-section:last-child {
  margin-bottom: 0;
}

.archive-list {
  list-style: none;
  padding: 0;
  max-width: 780px;
  margin: 0 auto;
}

.archive-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid #eee;
  font-size: 1.05rem;
}

.archive-list li:last-child {
  border-bottom: none;
}

.archive-list a {
  color: #D9342A;
  text-decoration: none;
}

.archive-list a:hover {
  text-decoration: underline;
}

.metadata-label {
  font-weight: 700;
  margin-right: 0.3rem;
}

.metadata-values {
  font-weight: 400;
}

/* (Old ELMCIP and Translation styles removed — now in .post-actions-row) */

/* --- Categories --- */
.post-categories {
  max-width: 780px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid #ddd;
}

.post-categories h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
  margin-bottom: 0.75rem;
}

.category-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-list li a,
.category-list li a:visited {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: #FFF0F0;
  color: #D9342A;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.category-list li a:hover,
.category-list li a:visited:hover {
  background: #D9342A;
  color: #fff;
  text-decoration: none;
}

/* ==========================================================================
   Page Layout
   ========================================================================== */
.page-content {
  padding: 2.5rem 0 3rem;
}

.page-title {
  max-width: 780px;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid #D9342A;
}

.page-body {
  max-width: 780px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.8;
}

.page-body p {
  margin-bottom: 1.25em;
}

/* ==========================================================================
   Home / Post Grid
   ========================================================================== */
.home-page {
  padding: 2.5rem 0 3rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* ==========================================================================
   Post Card
   ========================================================================== */
.post-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.post-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.post-card-image-link {
  display: block;
}

.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.post-card-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #D9342A 0%, #E8655C 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-heart {
  font-size: 3rem;
  color: #fff;
  opacity: 0.8;
}

.post-card-body {
  padding: 1.25rem;
}

.post-card-title {
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
}

.post-card-title a,
.post-card-title a:visited {
  color: #000;
}

.post-card-title a:hover {
  color: #D9342A;
}

.post-card-date {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.6rem;
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.post-card-read-more,
.post-card-read-more:visited {
  font-size: 0.85rem;
  font-weight: 600;
  color: #D9342A;
}

.post-card-read-more:hover {
  color: #D9342A;
}

/* ==========================================================================
   Category Page
   ========================================================================== */
.category-page {
  padding: 2.5rem 0 3rem;
}

.category-header {
  margin-bottom: 2rem;
}

.category-title {
  font-size: 1.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #D9342A;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ddd;
  text-align: center;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.pagination a,
.pagination a:visited {
  background: #FFF0F0;
  color: #D9342A;
  font-weight: 500;
}

.pagination a:hover,
.pagination a:visited:hover {
  background: #D9342A;
  color: #fff;
  text-decoration: none;
}

.pagination-info {
  color: #888;
  font-size: 0.9rem;
}

.show-more-link {
  display: inline-block;
  margin-left: 1rem;
}

.news-nav-btn {
  display: inline-block;
  margin: 0 0.5rem;
}

/* ==========================================================================
   Contact Form
   ========================================================================== */
.contact-info {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}
.contact-info p {
  margin: 0.3rem 0;
}
.contact-form {
  max-width: 600px;
  margin: 1.5rem 0;
}
.contact-form .form-group {
  margin-bottom: 1rem;
}
.contact-form label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: bold;
}
.contact-form .required {
  color: #D9342A;
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1rem;
  box-sizing: border-box;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: #D9342A;
  outline: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #D9342A;
  color: #fff;
  padding: 2rem 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
}

.search-input {
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #000;
  font-size: 0.85rem;
  font-family: Georgia, "Times New Roman", Times, serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder {
  color: #999;
}

.search-input:focus {
  border-color: #D9342A;
  box-shadow: 0 0 0 2px rgba(217, 52, 42, 0.15);
}

/* --- Search Results --- */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  color: #000;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-height: 400px;
  overflow-y: auto;
  margin-top: 0.25rem;
  z-index: 100;
}

.search-results.hidden {
  display: none;
}

.search-result-item {
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
  transition: background 0.15s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: #FFF0F0;
}

.search-result-title {
  font-weight: 600;
  color: #000;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.search-result-excerpt {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.4;
}

.search-result-meta {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 0.2rem;
}

.search-no-results {
  padding: 1rem;
  text-align: center;
  color: #888;
  font-size: 0.9rem;
}

/* --- Footer Info --- */
.footer-copyright {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.footer-copyright a,
.footer-copyright a:visited {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-copyright a:hover {
  color: #fff;
}

/* ==========================================================================
   WordPress Content Compatibility
   ========================================================================== */
.wp-caption {
  max-width: 100%;
  margin: 1.5em auto;
}

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

.wp-caption-text {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
  margin-top: 0.5em;
  text-align: center;
}

.alignleft {
  float: left;
  margin: 0.5em 1.5em 1em 0;
}

.alignright {
  float: right;
  margin: 0.5em 0 1em 1.5em;
}

.aligncenter {
  display: block;
  margin: 1.5em auto;
  text-align: center;
}

.wp-block-image {
  margin: 1.5em 0;
}

.wp-block-image img {
  max-width: 100%;
  height: auto;
}

.wp-block-image figcaption {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
  margin-top: 0.5em;
  text-align: center;
}

/* ==========================================================================
   Landing Page (Language Selector)
   ========================================================================== */
.landing-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #fff;
  color: #000;
  text-align: center;
  padding: 2rem;
}

.landing-title {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #000;
  letter-spacing: 0.02em;
}

.landing-title .heart {
  color: #D9342A;
  font-size: 1.1em;
}

.landing-subtitle {
  font-size: 1.1rem;
  color: #666;
  font-style: italic;
  margin-bottom: 2.5rem;
}

.landing-buttons {
  display: flex;
  gap: 1.5rem;
}

.landing-btn {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}

.landing-btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.landing-btn-en,
.landing-btn-en:visited {
  background: #D9342A;
  color: #fff;
}

.landing-btn-en:hover {
  background: #b82a22;
  color: #fff;
}

.landing-btn-es,
.landing-btn-es:visited {
  background: #fff;
  color: #D9342A;
  border: 2px solid #D9342A;
}

.landing-btn-es:hover {
  background: #FFF0F0;
  color: #D9342A;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
  .hamburger-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    margin-top: 0;
    border-top: none;
    background: #fff;
    border-top: 1px solid #eee;
  }

  .site-nav.open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
  }

  .nav-list li a {
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid #eee;
  }

  .header-inner {
    padding: 0.5rem 1.5rem;
  }

  .site-title {
    font-size: 1.35rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .post-header-bar .post-title {
    font-size: 1.5rem;
  }

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

  .landing-buttons {
    flex-direction: column;
    gap: 1rem;
  }

  .header-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .header-search {
    width: 100%;
    order: 3;
  }

  /* WordPress responsive */
  .alignleft,
  .alignright {
    float: none;
    display: block;
    margin: 1em auto;
  }
}

@media (max-width: 480px) {
  .post-card-image,
  .post-card-placeholder {
    height: 160px;
  }

  .site-description {
    display: none;
  }
}
