/*
Theme Name: Optima
Theme URI: https://example.com/
Author: Your Name
Author URI: https://example.com/
Description: Mobile-friendly, SEO base WordPress theme
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: optima
*/

body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  background: #2a2a2a;
  color: #e4e4e4;
}

/* Make layout fill viewport so footer stays at bottom when content is short */
html, body {
  height: 100%;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main.container {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1200px;
}

.container {
  margin: 0 auto;
}

header, footer {
  background: #2a2a2a;
  padding: 0.5rem;
  /* make header/footer backgrounds full-bleed across the viewport */
  width: 100vw;
  box-sizing: border-box;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.centered-image-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.content-section {
  padding: 1rem;
}

/* Article Content */
.entry-content {
  font-size: 1.125rem;
  line-height: 1.8;
}

.entry-content p {
  margin: 1rem 0;
}

/* Post Title Header */
.post-header {
  text-align: left;
  margin: auto;
  width: auto;
  max-width: 1200px;
  border-bottom: 1px solid #444;
  padding: 0 0 1.5rem 0;
}

.post-title {
  font-family: 'Inter', Arial, sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.post-date {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.9rem;
  color: #aaaaaa;
  margin-top: 0.5rem;
  font-weight: 400;
}

.section-heading {
  font-family: 'Inter', Arial, sans-serif;
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  font-weight: 600;
  color: #ff751f;
  margin: 2rem 0 1rem 0;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-date {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.9rem;
  color: #aaaaaa;
  margin-top: 0.5rem;
  font-weight: 400;
}

.image-with-bar {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.image-with-bar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-select {
  position: absolute;
  top: clamp(8px, 2vw, 16px);
  z-index: 10;
  background: rgba(40,40,40,0.9);
  color: #e4e4e4;
  border-radius: 4px;
  border: 1px solid #555;
  padding: clamp(2px, 0.5vw, 8px) clamp(6px, 1.5vw, 12px);
  font-size: clamp(0.75rem, 2.5vw, 1rem);
}
.left-select {
  left: clamp(8px, 2vw, 16px);
}
.right-select {
  right: clamp(8px, 2vw, 16px);
}

.base-image {
  display: block;
  position: relative;
  z-index: 1;
}

.overlay-image {
  position: absolute;
  top: 0;
  left: 0;
  object-fit: cover;
  z-index: 2;
  pointer-events: none;
}

/* Fullscreen toggle button */
.compare-fullscreen-btn {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  background: rgba(40,40,40,0.9);
  color: #e4e4e4;
  border: 1px solid #555;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

/* Styling when element is fullscreen (supported by browsers) */
.aspect-ratio-16-9:fullscreen, .aspect-ratio-16-9:-webkit-full-screen, .aspect-ratio-16-9:-moz-full-screen, .aspect-ratio-16-9:-ms-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  padding-top: 0;
}

/* Fallback class applied by JS when fullscreen change fires (useful for styling in older browsers) */
.aspect-ratio-16-9.compare-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  background: #000;
  padding-top: 0;
}

.vertical-bar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: #e4e4e4;
  opacity: 0.95;
  z-index: 2;
  height: 100%;
  top: 0;
  margin-bottom: 2rem;
  user-select: none;
}

.drag-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: auto; /* handle receives pointer events so circle is draggable */
  cursor: move;
}

.drag-handle .circle {
  position: absolute;
  width: 24px;
  height: 24px;
  background: rgba(40,40,40,0.95);
  border-radius: 50%;
  border: 2px solid #e4e4e4;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.drag-handle .circle::before,
.drag-handle .circle::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.drag-handle .circle::before {
  left: 4px; /* move outward to increase gap between triangles */
  transform: translateY(-50%);
  border-right: 6px solid #e4e4e4; /* left-pointing triangle inside circle */
}

.drag-handle .circle::after {
  right: 4px; /* move outward to increase gap between triangles */
  transform: translateY(-50%);
  border-left: 6px solid #e4e4e4; /* right-pointing triangle inside circle */
}

/* cursor while dragging */
.drag-handle.dragging { cursor: grabbing; }

.aspect-ratio-16-9 {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.image-with-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.image-with-bar img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Post hero styling */
.post-hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  display: block;
  margin-bottom: 0.5rem;
}
.post-hero img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

/* Hero title overlay */
.post-hero {
  position: relative;
  overflow: hidden;
}
.post-hero img {
  display: block;
  width: 100%;
  height: auto;
}
.post-hero .hero-title {
  display: none;
}

.hero-logo {
  height: 50%;
  max-width: 50%;
  position: absolute;
  left: 1rem;
  bottom: 24px;
  z-index: 10;
}

.hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* If no hero image, keep normal heading styles */
.entry-header .entry-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  margin: 0 0 0.5rem 0;
}

/* Modern search bar under the image */
.search-bar-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 640px;
  background: #2a2a2a;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  padding: 6px;
  border: 1px solid #444;
}
.search-bar input {
  flex: 1 1 auto;
  border: none;
  outline: none;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 1rem;
  background: transparent;
  color: inherit;
}
.search-bar button {
  background: #e4e4e4;
  color: #1a1a1a;
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}
.search-bar button:hover {
  opacity: 0.95;
}
.screen-reader-text {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  padding: 0 !important;
  border: 0 !important;
  height: 1px !important;
  width: 1px !important;
  overflow: hidden;
}

.recent-posts-wrapper {
  display: block;
  margin-top: 3rem;
}

/* Category headings on homepage */
.category-heading {
  font-family: 'Inter', Arial, sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  color: #ff751f;
  margin: 3rem 0 1.5rem 0;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.category-heading.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.category-heading a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.category-heading a:hover {
  opacity: 0.85;
}

.category-heading:first-of-type {
  margin-top: 0;
}
.recent-posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.recent-posts-list li {
  background: rgba(255,255,255,0.1);
  padding: 6px 10px;
  border-radius: 999px;
}
.recent-posts-list a {
  text-decoration: none;
  color: inherit;
  font-size: 0.95rem;
}

.recent-posts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  justify-items: center;
  align-items: start;
  margin-top: 0.5rem;
  width: 100%;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.recent-posts-grid.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.recent-posts-grid.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.recent-post-box {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3; /* 2:3 box */
  border-radius: 8px;
  overflow: hidden;
  background: #2a2a2a;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
  position: relative; /* for sheen pseudo-element */
  transition: transform 240ms cubic-bezier(.2,.9,.3,1), box-shadow 240ms ease, background-color 240ms ease, opacity 200ms ease;
  opacity: 1;
}

.recent-post-box::after {
  /* moving sheen (default hidden - only activated for hover-capable devices) */
  content: '';
  position: absolute;
  top: -40%;
  left: -40%;
  width: 180%;
  height: 180%;
  background: linear-gradient(120deg, rgba(255,255,255,0) 35%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0) 65%);
  transform: translateX(-100%) rotate(16deg);
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0;
  transition: transform 700ms cubic-bezier(.2,.9,.3,1), opacity 240ms ease;
}

/* Only enable hover animations on devices that support hover (avoid touch devices) */
@media (hover: hover) and (pointer: fine) {
  .recent-post-box:hover {
    transform: translateY(-4px) scale(1.015);
    box-shadow: 0 10px 26px rgba(0,0,0,0.4);
  }
  .recent-post-box:hover::after {
    transform: translateX(100%) rotate(16deg);
    opacity: 1;
  }
  .recent-post-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0));
    transition: background-color 240ms ease, opacity 240ms ease;
    opacity: 0;
  }
  .recent-post-box:hover::before {
    opacity: 1;
  }
}

.recent-post-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Text overlay on post boxes */
.recent-post-box .post-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  padding: 6px 12px;
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  font-weight: 500;
  border-radius: 3px;
  pointer-events: none;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.recent-post-box-empty {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #333, #444);
}

.sticky-header {
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  background: #1a1a1a;
}

.site-branding {
  text-align: center;
  margin: 0;
}

.custom-logo-link {
  display: inline-block;
  line-height: 0;
  transition: transform 200ms ease, opacity 300ms ease;
}

.custom-logo-link:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.custom-logo {
  max-height: 80px;
  width: auto;
  height: auto;
  display: block;
}

.site-title {
  text-align: center;
  margin: 0;
  padding: 1rem 0;
}
.site-title a {
  color: #e4e4e4;
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
  font-family: 'Inter', Arial, sans-serif;
  transition: color 300ms ease, transform 200ms ease;
  display: inline-block;
  position: relative;
}
.site-title a:hover {
  color: #fff;
  transform: translateY(-1px);
}
.site-title a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e4e4e4, transparent);
  transition: width 300ms ease, left 300ms ease;
}
.site-title a:hover::after {
  width: 100%;
  left: 0;
}

/* Hide header on homepage only */
.home header.sticky-header {
  display: none;
}

/* Home Page Logo Section */
.home-logo-wrapper {
  text-align: center;
  padding-top: 1rem;
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.home-logo-wrapper .custom-logo-link {
  display: inline-block;
  line-height: 0;
  transition: transform 300ms ease, opacity 300ms ease;
}

.home-logo-wrapper .custom-logo-link:hover {
  transform: translateY(-4px);
  opacity: 0.85;
}

.home-logo-wrapper .custom-logo {
  max-height: 120px;
  max-width: 90vw;
  width: auto;
  height: auto;
  display: block;
}

.home-logo-wrapper .site-title {
  padding: 0;
}

.home-logo-wrapper .site-title a {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

@media (max-width: 600px) {
  .custom-logo {
    max-height: 40px;
  }
  
  .recent-posts-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 per row on smartphones */
  }
  nav {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Settings Table */
.settings-table-wrapper {
  margin: auto;
  overflow-x: auto;
  max-width: 100%;
}
.settings-table {
  width: 100%;
  border-collapse: collapse;
  background: #2a2a2a;
  color: #e4e4e4;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  table-layout: fixed;
}
.settings-table th, .settings-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #444;
}
.settings-table th {
  background-color: #333;
  font-weight: 600;
}
.settings-table tbody tr:last-child td {
  border-bottom: none;
}
.settings-table tbody tr:hover {
  background-color: #383838;
}
.settings-table td:first-child {
  font-weight: bold;
  color: #f0f0f0;
}

.mobile-only {
    display: none;
}

.settings-preset-selector {
    margin-bottom: 1rem;
}

.settings-preset-selector label {
    margin-right: 0.5rem;
}

.settings-preset-selector select {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #555;
    background: #333;
    color: #e4e4e4;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
    .mobile-only {
        display: block;
    }
}

/* Modern Comments Section */
.comments-section {
  margin: 2rem 0;
  border-top: 1px solid #444;
  padding-top: 2rem;
}

.comments-section .comments-title,
.comments-section h2, 
.comments-section h3 {
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment {
  padding: 1.5rem 0;
  border-bottom: 1px solid #444;
}

.comment:last-child {
  border-bottom: none;
}

.comment-author {
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.comment-author a {
  color: #ffffff;
  text-decoration: none;
  pointer-events: none;
}

.comment-meta {
  font-size: 0.875rem;
  color: #cccccc;
  margin-bottom: 1rem;
}

.comment-meta a {
  color: #cccccc;
  text-decoration: none;
  pointer-events: none;
}

.comment-edit-link {
  color: #cccccc;
  text-decoration: none;
  pointer-events: none;
}

.comment-content {
  color: #e4e4e4;
  line-height: 1.6;
  font-size: 1rem;
}

.comment-reply-link {
  color: #cccccc;
  text-decoration: underline;
  font-size: 0.875rem;
  display: inline-block;
  margin-top: 1rem;
}

.comment-reply-link:hover {
  color: #ffffff;
}

.comment-form {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #444;
}

.comment-form label {
  color: #ffffff;
  font-weight: 400;
  margin-bottom: 0.5rem;
  display: block;
  font-size: 1rem;
}

.comment-form input, .comment-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #555;
  border-radius: 4px;
  background: transparent;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  margin-bottom: 1rem;
  box-sizing: border-box;
  font-size: 1rem;
}

.comment-form input:focus, .comment-form textarea:focus {
  outline: none;
  border-color: #ffffff;
}

.comment-form input[type="submit"] {
  background: transparent;
  color: #ffffff;
  border: 1px solid #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 400;
  width: auto;
  font-size: 1rem;
}

.comment-form input[type="submit"]:hover {
  background: #ffffff;
  color: #1a1a1a;
}

/* Breadcrumbs Styling */
.breadcrumbs {
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 1rem;
}

.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
}

.breadcrumbs a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumbs a:hover {
  color: #fff;
  text-decoration: underline;
}

.breadcrumbs .separator {
  margin: 0 0.5em;
  color: #777;
}

.breadcrumbs li:last-child span {
  color: #fff;
  font-weight: 500;
}

/* Buttons */
.button-primary {
  display: inline-block;
  background-color: #ff751f;
  color: #1a1a1a;
  padding: 12px 28px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.button-primary:hover,
.button-primary:focus {
  background-color: #ff8c40;
  transform: translateY(-2px);
  color: #1a1a1a;
}

/* Archive Page Layout */
.archive-page .archive-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid #444;
  padding-bottom: 1.5rem;
}

.archive-page .archive-title {
  font-family: 'Inter', Arial, sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.archive-page .archive-description {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: #ccc;
}

/* Pagination Styling */
.pagination {
  margin: 3rem 0 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pagination .nav-links {
  display: flex;
  gap: 0.5rem;
}

.pagination .page-numbers {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid #555;
  color: #ccc;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pagination .page-numbers:hover {
  background-color: #444;
  color: #fff;
}

.pagination .page-numbers.current {
  background-color: #ff751f;
  color: #1a1a1a;
  border-color: #ff751f;
  font-weight: 600;
}

.pagination .page-numbers.dots {
  border: none;
  padding: 0.5rem 0.25rem;
}
