/*
Theme Name: ModernMag
Theme URI: https://example.com
Author: Custom Theme
Author URI: https://example.com
Description: A modern magazine-style WordPress theme with a clean grid layout, perfect for news and content-rich websites.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: modernmag
*/


.post-content a 
{
	color:blue !important;
}



* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Added overflow-x hidden to prevent horizontal scrolling */
html {
  overflow-x: hidden;
  width: 100%;
}

body {
  /*font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;*/
	font-family: "Calibri", "Calibri Regular", Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
  /* Prevent text size adjustment on mobile */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Prevent horizontal overflow */
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

a {
  color: #000;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

a:hover {
  opacity: 0.7;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Updated site-main margin for responsive header */
.site-main {
  margin-top: 120px;
  padding-top: 20px;
}

@media (max-width: 1000px) {
  .site-main {
    margin-top: 80px;
    padding-top: 15px;
  }
}

@media (max-width: 768px) {
  .site-main {
    margin-top: 70px;
    padding-top: 15px;
  }
}

@media (max-width: 480px) {
  .site-main {
    margin-top: 65px;
    padding-top: 10px;
  }
}

/*hide admin bar*/
/*
#wpadminbar {
  display: none;
}
*/

/* Completely refactored header for responsive behavior */
/* Dark header background */
.header {
  position: fixed;
  top: 0;
  left: 0;
  /* Ensure header fits viewport and doesn't overflow */
  width: 100%;
  max-width: 100vw;
  background-color: #1a1a1a;
  z-index: 1000;
  border-bottom: 1px solid #333;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  overflow-x: hidden;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 100px;
  padding: 15px 20px;
  /* Ensure container doesn't overflow */
  max-width: 100%;
  width: 100%;
}

.site-header {
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.site-logo {
  max-width: 200px;
}

.site-logo img {
  max-height: 50px;
  width: auto;
}

/* Simplified logo styling with flexbox */
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  /* Prevent logo from pushing hamburger off screen */
  max-width: calc(100% - 60px);
}

.logo a {
  display: block;
  line-height: 0;
}

/* White logo using CSS filter */
.logo img {
  width: 80px;
  height: auto;
  display: block;
  filter: brightness(0) invert(1);
  max-width: 100%;
}

.main-navigation {
  display: flex;
  gap: 30px;
  list-style: none;
}

.main-navigation a {
  font-weight: 500;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.date-display {
  font-size: 14px;
  color: #666;
  margin: 20px 0;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 40px 0;
}

.featured-grid.large {
  grid-template-columns: repeat(2, 1fr);
}

.featured-grid.triple {
  grid-template-columns: repeat(3, 1fr);
}

.post-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.post-card:hover {
  transform: translateY(-5px);
}

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

.post-card.large img {
  height: 400px;
}

.post-category {
  display: inline-block;
  background-color: #000;
  color: #fff;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.post-card h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 15px;
  margin-bottom: 10px;
}

.post-card.large h3 {
  font-size: 24px;
}

.post-meta {
  font-size: 13px;
  color: #999;
}

.section-header {
  border-top: 2px solid #000;
  padding-top: 20px;
  margin: 60px 0 30px;
}

.section-header h2 {
  font-size: 28px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.more-link {
  display: inline-block;
  margin-top: 30px;
  padding: 12px 30px;
  background-color: #000;
  color: #fff;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.more-link:hover {
  background-color: #333;
  opacity: 1;
}

.site-footer {
  background-color: #111;
  color: #fff;
  padding: 40px 0 20px;
  margin-top: 80px;
}

/* Footer bottom two-column layout */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 25px;
  flex-wrap: wrap;
  /* Allows stacking on small screens */
}

/* ================================
   BASE STYLES
================================ */

.footer-sponsor {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 4px solid #000;
}

.footer-sponsor a {
  display: flex;
  align-items: center;
}

.footer-sponsor img {
  height: auto;
  display: block;
}


/* ================================
   DESKTOP (Floating bottom-right)
================================ */

@media (min-width: 768px) {

  .footer-sponsor {
    bottom: 20px;
    right: 20px;
    padding: 15px;
    width: auto;          /* prevent full width */
  }

  .footer-sponsor a {
    gap: 15px;
  }

  /* First logo bigger */
  .logo-espa {
    max-width: 300px;
  }

  /* Second logo smaller */
  .logo-perifereia {
    max-width: 90px;
  }
}


/* ================================
   MOBILE (Full-width bottom bar)
================================ */

@media (max-width: 767px) {

  .footer-sponsor {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 10px 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
  }

  .footer-sponsor a {
    width: 100%;
  }

  /* First logo bigger */
  .logo-espa {
    max-width: 70%;
  }

  /* Second logo aligned right */
  .logo-perifereia {
    max-width: 20%;
    margin-left: auto;
  }
}







/* Copyright text */
.footer-copy {
  text-align: right;
  font-size: 14px;
  color: #ccc;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-copy {
    text-align: center;
    margin-top: 15px;
  }

  /* Added responsive footer menu styling for mobile */
  .footer-menu {
    gap: 15px 20px;
    font-size: 13px;
  }

  .footer-menu a {
    font-size: 13px;
  }

  .main-navigation {
    display: none;
  }

  .featured-grid,
  .featured-grid.large,
  .featured-grid.triple {
    grid-template-columns: 1fr;
  }

  .post-card img,
  .post-card.large img {
    height: 250px;
  }

  .header .container {
    min-height: 55px;
    padding: 8px 12px;
  }

  .logo img {
    /* Even smaller logo for mobile phones */
    width: 45px;
  }

  /* Ensure hamburger displays properly on smaller screens */
  .hamburger {
    display: flex !important;
    width: 28px;
    height: 21px;
  }

  .hamburger-line {
    height: 2.5px;
  }

  /* Adjusted hamburger animation for smaller size */
  .hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }
}

/* Improved hamburger button positioning and styling */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  transition: transform 0.3s ease;
  position: relative;
  flex-shrink: 0;
}

.hamburger:hover {
  transform: scale(1.1);
}

.hamburger:focus {
  outline: 2px solid #e91e63;
  outline-offset: 4px;
}

/* White hamburger lines */
.hamburger-line {
  width: 100%;
  height: 3px;
  background-color: #ffffff;
  border-radius: 3px;
  transition: all 0.3s ease;
  transform-origin: center;
  display: block;
}

/* Hamburger Animation */
.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

/* Refactored navigation for desktop - removed negative positioning */
.nav {
  display: flex;
  align-items: center;
}

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

/* White navigation links for dark header */
.nav-list li a {
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
  position: relative;
  display: block;
  padding: 0.5rem 0;
}

.nav-list li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #e91e63;
  transition: width 0.3s ease;
}

.nav-list li a:hover {
  color: #e91e63;
}

.nav-list li a:hover::after {
  width: 100%;
}

/* Enhanced mobile responsive styles with better header sizing */
@media (max-width: 1000px) {
  .header .container {
    /* Reduced header height for mobile */
    min-height: 60px;
    padding: 8px 15px;
    /* Ensure proper spacing between logo and hamburger */
    gap: 10px;
  }

  .logo img {
    /* Smaller logo for tablets */
    width: 55px;
  }

  .logo {
    /* Reduce max-width for smaller screens */
    max-width: calc(100% - 50px);
  }

  /* Force hamburger to display as flex on mobile */
  .hamburger {
    display: flex !important;
  }

  /* Dark mobile menu background */
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background-color: #1a1a1a;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    padding-top: 70px;
    overflow-y: auto;
    display: block;
  }

  .nav.active {
    right: 0;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 0 2rem;
  }

  /* Dark borders for mobile menu items */
  .nav-list li {
    border-bottom: 1px solid #333;
  }

  /* Light font color for mobile menu */
  .nav-list li a {
    display: block;
    padding: 1rem 0;
    font-size: 1rem;
    color: #fff;
  }

  .nav-list li a::after {
    bottom: 0.8rem;
  }
}

.footer-menu {
  display: flex;
  justify-content: center;
  gap: 30px;
  list-style: none;
  margin-bottom: 20px;
  /* Added flex-wrap to allow menu items to wrap on smaller screens */
  flex-wrap: wrap;
  padding: 0 15px;
}

.footer-menu a {
  color: #fff;
  font-size: 14px;
  /* Added white-space to prevent link text from breaking awkwardly */
  white-space: nowrap;
}

/* Added extra small mobile optimization */
@media (max-width: 480px) {
  .header .container {
    /* Further reduced for small phones */
    min-height: 50px;
    padding: 6px 10px;
    /* Tighter gap for very small screens */
    gap: 8px;
  }

  .logo img {
    /* Minimum logo size for very small screens */
    width: 40px;
  }

  .logo {
    /* Even smaller max-width for tiny screens */
    max-width: calc(100% - 40px);
  }

  .nav {
    width: 100%;
    max-width: 280px;
  }

  /* Ensure hamburger is always visible on smallest screens */
  .hamburger {
    display: flex !important;
    width: 26px;
    height: 20px;
  }

  .hamburger-line {
    height: 2px;
  }

  /* Adjusted hamburger animation for smallest size */
  .hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  /* Added extra small screen footer menu adjustments */
  .footer-menu {
    gap: 12px 15px;
    padding: 0 10px;
  }

  .footer-menu a {
    font-size: 12px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}
/* ================================
   WordPress Image Caption - Fully Responsive
   ================================ */

/* Container figure */
figure.wp-caption {
    max-width: 100%;       /* never exceed page width */
    width: auto;           /* shrink to fit content */
    margin: 1.5em auto;    /* center by default */
    text-align: center;
    box-sizing: border-box; /* prevent padding overflow */
}

/* Images: always scale to fit container */
figure.wp-caption img {
    max-width: 100%;       /* never overflow container */
    width: 100%;           /* fill container width */
    height: auto;          /* maintain aspect ratio */
    display: block;
    margin: 0 auto;
}

/* Caption text styling */
figure.wp-caption figcaption.wp-caption-text {
    display: block;
    margin-top: 6px;
    padding: 6px 10px;
    font-size: 14px;
    line-height: 1.4;
    font-style: italic;
    color: #555;
    text-align: center;
    background-color: #f6f6f6;
    border-radius: 4px;
    word-wrap: break-word; /* long words won't break layout */
}

/* Float alignment */
figure.wp-caption.alignleft {
    float: left;
    margin-right: 1.5em;
    text-align: left;
}

figure.wp-caption.alignright {
    float: right;
    margin-left: 1.5em;
    text-align: right;
}

figure.wp-caption.aligncenter {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Ensure caption visibility */
.wp-caption-text,
figcaption {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Optional: responsive margin for small screens */
@media (max-width: 768px) {
    figure.wp-caption.alignleft,
    figure.wp-caption.alignright {
        float: none;
        margin: 1em auto;
        text-align: center;
    }
}

/*GALLERY CSS*/

/* Lightbox overlay */
.wp-gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

/* Active */
.wp-gallery-lightbox.active {
    display: flex;
}

/* Image */
.wp-gallery-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

/* Buttons */
.wp-gallery-lightbox button {
    position: absolute;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    padding: 10px 15px;
    opacity: 0.8;
}

.wp-gallery-lightbox button:hover {
    opacity: 1;
}

/* Prev / Next */
.wp-gl-prev { left: 20px; }
.wp-gl-next { right: 20px; }

/* Close */
.wp-gl-close {
    top: 15px;
    right: 20px;
    font-size: 35px;
}

/* Mobile tweak */
@media (max-width: 768px) {
    .wp-gallery-lightbox button {
        font-size: 32px;
    }
}


/* Better gallery grid */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
    align-items: start; /* Align items to top */
}

/* Gallery figure - consistent card layout */
.gallery figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Thumbnail container */
.gallery-icon {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    aspect-ratio: 1 / 1; /* square thumbnails */
    background: #111;
    flex-shrink: 0; /* Don't shrink the image container */
}

/* Images */
.gallery-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

/* Hover zoom */
.gallery-icon:hover img {
    transform: scale(1.08);
}


/* Dark overlay */
.gallery-icon::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

/* Zoom icon */
.gallery-icon::after {
    content: "🔍";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: #fff;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 2;
}

/* Show overlay + icon on hover */
.gallery-icon:hover::before,
.gallery-icon:hover::after {
    opacity: 1;
    transform: scale(1);
}

.gallery-icon::before,
.gallery-icon::after {
    pointer-events: none;
}

.gallery-icon::after {
    content: none;
}

/* Caption styling - consistent spacing */
.gallery figcaption,
.gallery-caption {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    min-height: 0; /* Allow captions to be any height */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Empty caption placeholder - maintains spacing when no caption */
.gallery figure:not(:has(figcaption)) .gallery-icon,
.gallery figure:not(:has(.gallery-caption)) .gallery-icon {
    margin-bottom: 0;
}

.wp-gl-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 18px;
    text-align: center;
    max-width: 90%;
    background: rgba(0,0,0,0.5);
    padding: 10px 15px;
    border-radius: 6px;
    line-height: 1.4;
}

/* Hide lightbox caption when empty */
.wp-gl-caption:empty {
    display: none;
}

