/*
Theme Name: ElReloj Theme
Theme URI: https://elreloj.net
Author: ElReloj
Author URI: https://elreloj.net
Description: Custom theme for ElReloj.net blog that matches the main site design
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: elreloj-theme
*/

/* Import main site styles */
:root {
  --primary-color: #3b82f6;
  --secondary-color: #60a5fa;
  --dark-bg: #1a1a1a;
  --dark-content-bg: #2c2c2c;
  --light-bg: #f0f2f5;
  --light-content-bg: #ffffff;
  --text-dark: #333333;
  --text-light: #f0f2f5;
  --sidebar-width: 300px;
  --content-width: 800px;
  --container-padding: 1rem;
}

/* Common styles for all applications - matching main site */
body {
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background-color: #f0f2f5;
  transition: background-color 0.3s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Add specific font settings for different text elements to match main site */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: Arial, sans-serif;
  font-weight: bold;
  color: #333333;
  line-height: 1.2;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: #f0f2f5;
}

p,
li,
td,
th,
input,
textarea,
button,
select {
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

/* Ensure consistent font sizes */
h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

p,
li {
  font-size: 1rem;
}

.entry-meta,
.widget {
  font-size: 0.9rem;
}

/* Ensure consistent font weights */
strong,
b {
  font-weight: bold;
}

/* Ensure consistent link styling */
a {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #60a5fa;
}

body.dark-mode a {
  color: #60a5fa;
}

body.dark-mode a:hover {
  color: #93c5fd;
}

.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: var(--container-padding);
  width: 100%;
  box-sizing: border-box;
}

header {
  background-color: #333;
  color: white;
  padding: 1rem;
  width: 100%;
  box-sizing: border-box;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-container a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: white;
}

.logo-container svg {
  height: 40px;
}

nav ul {
  list-style-type: none;
  padding: 0;
  display: flex;
  margin: 0;
  flex-grow: 1;
}

nav ul li {
  margin: 0 1rem;
}

nav ul li a {
  color: white;
  text-decoration: none;
  transition: color 0.2s;
}

nav ul li a:hover,
nav ul li.active a {
  color: #60a5fa;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  background: none;
  border: none;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 2px 0;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.dark-mode-toggle {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.5rem;
  margin-left: auto;
}

footer {
  background-color: #333;
  color: white;
  padding: 1rem;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

footer p {
  margin: 0.5rem 0;
}

footer a {
  color: white;
  text-decoration: none;
  margin: 0 0.5rem;
  transition: color 0.2s;
}

footer a:hover {
  color: #60a5fa;
}

body.dark-mode {
  background-color: #1a1a1a;
  color: #f0f2f5;
}

/* WordPress specific styles */
.site-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  padding: 0 var(--container-padding);
  box-sizing: border-box;
}

.entry-content {
  background-color: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  transition: background-color 0.3s;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

body.dark-mode .entry-content {
  background-color: #2c2c2c;
}

.entry-title {
  color: var(--primary-color);
  margin-top: 0;
}

.entry-title a {
  color: var(--primary-color);
  text-decoration: none;
}

.entry-title a:hover {
  text-decoration: underline;
}

.entry-meta {
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

body.dark-mode .entry-meta {
  color: #aaa;
}

.post-navigation {
  display: flex;
  justify-content: space-between;
  margin: 2rem 0;
  flex-wrap: wrap;
  gap: 1rem;
}

.post-navigation a {
  color: var(--primary-color);
  text-decoration: none;
}

.post-navigation a:hover {
  text-decoration: underline;
}

/* Read more link */
.read-more {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  text-decoration: none;
  margin-top: 1rem;
  transition: opacity 0.2s;
}

.read-more:hover {
  opacity: 0.9;
}

/* Comments */
.comments-area {
  background-color: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-top: 2rem;
  transition: background-color 0.3s;
}

body.dark-mode .comments-area {
  background-color: #2c2c2c;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

.comment-form input[type="submit"] {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
}

.comment-form input[type="submit"]:hover {
  opacity: 0.9;
}

/* Sidebar */
.sidebar {
  background-color: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
  height: fit-content;
}

body.dark-mode .sidebar {
  background-color: #2c2c2c;
}

.sidebar h2 {
  color: var(--primary-color);
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.sidebar ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.sidebar ul li {
  margin-bottom: 0.5rem;
}

.sidebar a {
  color: var(--text-dark);
  text-decoration: none;
}

body.dark-mode .sidebar a {
  color: var(--text-light);
}

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

/* Main site links widget - UPDATED FOR COMPACT DISPLAY */
.main-site-links {
  margin-bottom: 2rem;
}

/* Grid layout for timer tools */
.timer-tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.timer-tool-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background-color: #f5f5f5;
  border-radius: 5px;
  transition: all 0.2s;
  text-align: center;
  font-size: 0.85rem;
  height: 2.5rem;
}

.timer-tool-link:hover {
  background-color: #e5e5e5;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

body.dark-mode .timer-tool-link {
  background-color: #3a3a3a;
}

body.dark-mode .timer-tool-link:hover {
  background-color: #4a4a4a;
}

/* Responsive images */
.responsive-img,
.entry-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem 0;
}

/* Mobile responsive styles - matching main site */
@media (max-width: 1200px) {
  .site-content {
    padding: 0 var(--container-padding);
  }
}

@media (max-width: 992px) {
  .site-content {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 1.5rem;
  }

  .entry-content {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  /* Reset all positioning to ensure consistency */
  header nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0;
  }

  .hamburger {
    display: flex;
    order: 1;
    padding: 10px;
    z-index: 10;
  }

  .logo-container {
    order: 2;
    margin: 0;
    position: static;
    transform: none;
  }

  .dark-mode-toggle {
    order: 3;
    padding: 10px;
    z-index: 10;
    position: static;
    margin-left: auto;
  }

  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #333;
    z-index: 100;
    margin: 0;
    padding: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    order: 4;
    flex-basis: 100%;
  }

  nav ul.show {
    display: flex;
  }

  nav ul li {
    margin: 0;
    text-align: left;
    padding: 0;
    width: 100%;
    border-top: 1px solid #444;
  }

  nav ul li a {
    display: block;
    padding: 1rem 1.5rem;
    width: 100%;
  }

  nav ul li a:hover,
  nav ul li.active a {
    background-color: #444;
  }

  .logo-container svg {
    height: 30px;
  }

  .site-content {
    grid-template-columns: 1fr;
  }

  .sidebar {
    margin-top: 0;
    margin-bottom: 2rem;
  }

  .entry-content {
    padding: 1.25rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.35rem;
  }

  h3 {
    font-size: 1.15rem;
  }
}

@media (max-width: 480px) {
  .timer-tools-grid {
    grid-template-columns: 1fr;
  }

  .entry-content {
    padding: 1rem;
  }

  .post-navigation {
    flex-direction: column;
  }

  .post-navigation .nav-previous,
  .post-navigation .nav-next {
    width: 100%;
    text-align: center;
  }
}

/* Accessibility */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;\
  padding: 0;  1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Skip to content link for keyboard navigation */
.skip-link {
  background-color: var(--primary-color);
  color: white;
  font-weight: 700;
  left: 50%;
  padding: 0.5rem;
  position: absolute;
  transform: translateY(-100%);
  transition: transform 0.3s;
}

.skip-link:focus {
  transform: translateY(0%);
  z-index: 9999;
}
/* Mobile Menu Styles */
@media screen and (max-width: 768px) {
    /* Show hamburger menu on mobile */
    #hamburger-menu {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        cursor: pointer;
        padding: 10px;
        z-index: 1000;
        position: absolute;
        right: 60px;
        top: 15px;
        width: 30px;
        height: 25px;
    }
    
    /* Style hamburger icon */
    #hamburger-menu span {
        display: block;
        width: 100%;
        height: 3px;
        background-color: #f0f2f5;
        transition: all 0.3s ease;
    }
    
    /* Hide regular navigation menu by default on mobile */
    #nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: #333;
        flex-direction: column;
        padding: 20px 0;
        z-index: 999;
    }
    
    /* Style menu items in mobile view */
    #nav-menu li {
        margin: 10px 0;
        text-align: center;
        width: 100%;
    }
    
    /* Show menu when toggled */
    #nav-menu.show {
        display: flex !important;
    }
    
    /* Hamburger animation when menu is open */
    #hamburger-menu[aria-expanded="true"] span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 8px);
    }
    
    #hamburger-menu[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }
    
    #hamburger-menu[aria-expanded="true"] span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -8px);
    }
}

/* Ensure hamburger is hidden on desktop */
@media screen and (min-width: 769px) {
    #hamburger-menu {
        display: none !important;
    }
}

