/*
Theme Name: AZ Portfolio
Theme URI: https://anderzarragaphoto.com/
Author: Ander Zárraga
Author URI: https://anderzarragaphoto.com/
Description: Tema minimalista y elegante para portfolio de fotografía y blog personal. Incluye barra lateral fija con logotipo circular, menú vertical, enlaces a redes sociales y cuadrícula de publicaciones estilo Masonry limpia y responsiva.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: az-portfolio
Tags: portfolio, photography, blog, grid-layout, two-columns, custom-menu, custom-logo, featured-images, translation-ready, sticky-post
*/

/* ==========================================================================
   1. CSS Variables & Reset
   ========================================================================== */
:root {
  --az-bg-page: #f1f2f4;
  --az-bg-sidebar: #ffffff;
  --az-bg-card: #ffffff;
  --az-text-main: #1d1d1f;
  --az-text-muted: #6e6e73;
  --az-text-footer: #8e8e93;
  --az-accent: #1a1a1a;
  --az-border-light: #e8e8ed;
  --az-sidebar-width: 280px;
  --az-radius-card: 4px;
  --az-radius-sm: 4px;
  --az-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --az-font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--az-font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--az-text-main);
  background-color: var(--az-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--az-bg-page);
  color: var(--az-text-main);
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

/* ==========================================================================
   2. Layout Structure
   ========================================================================== */
.site-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Mobile Header Bar */
.mobile-header-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--az-border-light);
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
  z-index: 1050;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-brand .mobile-logo-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #4a4a4a;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
}

.mobile-brand .mobile-logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mobile-site-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.menu-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  border-radius: 4px;
}

.menu-toggle-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #1a1a1a;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Sidebar Styling */
.site-sidebar {
  width: var(--az-sidebar-width);
  min-width: var(--az-sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background-color: var(--az-bg-sidebar);
  border-right: 1px solid var(--az-border-light);
  padding: 44px 32px 30px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-overlay {
  display: none;
}

/* Sidebar Top Section */
.sidebar-top {
  display: flex;
  flex-direction: column;
}

.site-branding {
  text-align: left;
  margin-bottom: 24px;
}

.custom-logo-wrap {
  display: inline-block;
  margin-bottom: 8px;
}

.site-avatar-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #4f4f4f;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 42px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: transform 0.2s ease;
}

.site-avatar-circle:hover {
  transform: scale(1.03);
}

.site-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.site-title {
  margin: 12px 0 2px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-title a {
  color: var(--az-text-main);
}

.site-description {
  margin: 0;
  font-size: 13px;
  color: var(--az-text-muted);
}

/* Sidebar Divider */
.sidebar-divider {
  width: 100%;
  height: 1px;
  background-color: var(--az-border-light);
  margin: 12px 0 26px 0;
}

/* Primary Navigation */
.sidebar-navigation {
  margin-bottom: 24px;
}

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

.sidebar-navigation li {
  margin-bottom: 15px;
}

.sidebar-navigation a {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #4a4a4a;
  position: relative;
  padding: 2px 0;
}

.sidebar-navigation a:hover,
.sidebar-navigation .current-menu-item > a,
.sidebar-navigation .current_page_item > a {
  color: #000000;
}

.sidebar-navigation .current-menu-item > a::after,
.sidebar-navigation .current_page_item > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: #000000;
}

/* Social Icons */
.sidebar-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 24px 0;
  align-items: center;
}

.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #4a4a4a;
  color: #ffffff;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.social-icon-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.social-icon-btn.facebook {
  background-color: #1877f2;
}

.social-icon-btn.instagram {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.social-icon-btn.twitter,
.social-icon-btn.x {
  background-color: #0f1419;
}

.social-icon-btn.flickr {
  background-color: #ff0084;
}

.social-icon-btn.px500 {
  background-color: #000000;
}

.social-icon-btn.linkedin {
  background-color: #0077b5;
}

.social-icon-btn.email {
  background-color: #555555;
}

.social-icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Sidebar Secondary / Tagline / Bio */
.sidebar-bio {
  font-size: 13.5px;
  line-height: 1.5;
  color: #555555;
  margin-top: 4px;
}

.sidebar-bio p {
  margin: 0 0 10px 0;
}

.sidebar-secondary-menu {
  margin-top: 10px;
}

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

.sidebar-secondary-menu li {
  margin-bottom: 8px;
}

.sidebar-secondary-menu a {
  font-size: 13.5px;
  color: #555555;
}

.sidebar-secondary-menu a:hover {
  color: #000000;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 30px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--az-text-footer);
}

.sidebar-footer p {
  margin: 0 0 4px 0;
}

.sidebar-footer a {
  color: #666666;
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: #000000;
  text-decoration: underline;
}

/* ==========================================================================
   3. Main Content Area & Masonry Grid
   ========================================================================== */
.site-main-content {
  margin-left: var(--az-sidebar-width);
  width: calc(100% - var(--az-sidebar-width));
  min-height: 100vh;
  padding: 35px 36px 60px 36px;
  background-color: var(--az-bg-page);
}

/* Archive / Search Header */
.archive-header {
  margin-bottom: 30px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--az-border-light);
}

.archive-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.archive-description {
  font-size: 14px;
  color: var(--az-text-muted);
  margin: 0;
}

/* Masonry Grid Container */
.masonry-grid-wrap {
  width: 100%;
}

.masonry-grid {
  margin-left: -12px;
  margin-right: -12px;
  position: relative;
}

/* Fallback clearfix */
.masonry-grid::after {
  content: "";
  display: table;
  clear: both;
}

/* Grid Item sizing */
.masonry-grid .grid-item {
  width: calc(33.3333% - 24px);
  margin: 0 12px 24px 12px;
  float: left;
}

/* Post Card Component */
.post-card {
  background-color: var(--az-bg-card);
  border-radius: var(--az-radius-card);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  position: relative;
}

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

/* Card Featured Image */
.card-thumbnail-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  background-color: #e5e5ea;
}

.card-thumbnail-wrap img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.35s ease;
}

.post-card:hover .card-thumbnail-wrap img {
  transform: scale(1.02);
}

/* Watermark / Image Caption Overlay */
.card-image-caption {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  letter-spacing: 0.02em;
}

/* Card Body */
.card-body {
  padding: 18px 20px 22px 20px;
}

.card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
  word-wrap: break-word;
}

.card-title a {
  color: #1a1a1a;
}

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

/* Card Excerpt */
.card-excerpt {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #5e5e62;
  font-style: italic;
}

.card-excerpt p {
  margin: 0;
}

/* Card Meta (category or date) */
.card-meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f2f2f5;
  font-size: 11.5px;
  color: #99999f;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-meta a {
  color: #77777c;
}

.card-meta a:hover {
  color: #1a1a1a;
}

/* Sticky Post Badge */
.sticky-badge {
  display: inline-block;
  background-color: #1a1a1a;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

/* ==========================================================================
   4. Pagination
   ========================================================================== */
.pagination-container {
  padding: 30px 0 20px;
  text-align: center;
  clear: both;
}

.pagination-container .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 14px;
  margin: 0 4px;
  background-color: #ffffff;
  color: #333333;
  border-radius: var(--az-radius-sm);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.pagination-container .page-numbers:hover,
.pagination-container .page-numbers.current {
  background-color: #1a1a1a;
  color: #ffffff;
}

.pagination-container .page-numbers.dots {
  background: transparent;
  box-shadow: none;
  cursor: default;
  color: #888888;
}

/* ==========================================================================
   5. Single Post & Single Page Layout
   ========================================================================== */
.single-post-container,
.single-page-container {
  max-width: 880px;
  margin: 0 auto;
}

.article-single {
  background-color: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  padding: 44px 50px;
  margin-bottom: 40px;
}

.single-featured-image {
  margin: -44px -50px 36px -50px;
  position: relative;
}

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

.single-post-header {
  margin-bottom: 28px;
  text-align: left;
}

.single-post-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  color: #111111;
  margin: 0 0 12px 0;
}

.single-post-meta {
  font-size: 13px;
  color: var(--az-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.single-post-meta a {
  color: #444444;
}

.single-post-meta a:hover {
  color: #000000;
}

/* Entry Content (Gutenberg & Classic) */
.entry-content {
  font-size: 16px;
  line-height: 1.8;
  color: #2c2c2e;
}

.entry-content p {
  margin-bottom: 1.6em;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  color: #111111;
  font-weight: 700;
  margin-top: 1.8em;
  margin-bottom: 0.8em;
  line-height: 1.3;
}

.entry-content blockquote {
  margin: 2em 0;
  padding: 18px 24px;
  border-left: 3px solid #1a1a1a;
  background-color: #f7f7f9;
  font-style: italic;
  font-size: 17px;
  color: #444444;
}

.entry-content blockquote p:last-child {
  margin-bottom: 0;
}

.entry-content ul,
.entry-content ol {
  margin-bottom: 1.6em;
  padding-left: 1.5em;
}

.entry-content li {
  margin-bottom: 0.5em;
}

.entry-content img {
  border-radius: 4px;
  margin-bottom: 1.5em;
}

/* Post Navigation (Prev / Next) */
.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 40px 0;
}

.nav-previous,
.nav-next {
  flex: 1;
  background-color: #ffffff;
  padding: 20px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
}

.nav-previous:hover,
.nav-next:hover {
  transform: translateY(-2px);
}

.nav-next {
  text-align: right;
}

.nav-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--az-text-muted);
  margin-bottom: 4px;
}

.nav-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
}

/* ==========================================================================
   6. Comments Styling
   ========================================================================== */
.comments-area {
  background-color: #ffffff;
  padding: 40px 50px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-top: 30px;
}

.comments-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 30px 0;
}

.comment-list .comment {
  padding: 20px 0;
  border-bottom: 1px solid var(--az-border-light);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.comment-author .avatar {
  border-radius: 50%;
}

.comment-author .fn {
  font-weight: 700;
  color: #111111;
}

.comment-metadata {
  font-size: 12px;
  color: var(--az-text-muted);
}

.comment-content p {
  margin: 0 0 10px 0;
  font-size: 14.5px;
}

/* Comment Form */
.comment-respond {
  margin-top: 30px;
}

.comment-reply-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.comment-form p {
  margin-bottom: 16px;
}

.comment-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d1d6;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  background-color: #fafafa;
  transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: #1a1a1a;
  outline: none;
  background-color: #ffffff;
}

.comment-form .form-submit input[type="submit"] {
  background-color: #1a1a1a;
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.comment-form .form-submit input[type="submit"]:hover {
  background-color: #404040;
}

/* ==========================================================================
   7. Responsive Breakpoints
   ========================================================================== */
/* Medium Desktop: 2 Columns */
@media (max-width: 1140px) {
  .masonry-grid .grid-item {
    width: calc(50% - 24px);
  }
}

/* Tablet & Mobile (< 900px): Sidebar Collapsible */
@media (max-width: 900px) {
  .mobile-header-bar {
    display: flex;
  }

  .site-sidebar {
    transform: translateX(-100%);
    box-shadow: 0 0 20px rgba(0,0,0,0.15);
    z-index: 1200;
  }

  body.sidebar-open .site-sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.45);
    z-index: 1150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  body.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .site-main-content {
    margin-left: 0;
    width: 100%;
    padding: 85px 20px 40px 20px; /* offset for fixed mobile header */
  }

  .article-single,
  .comments-area {
    padding: 30px 24px;
  }

  .single-featured-image {
    margin: -30px -24px 24px -24px;
  }

  .single-post-title {
    font-size: 26px;
  }
}

/* Small Mobile (< 640px): 1 Column */
@media (max-width: 640px) {
  .masonry-grid .grid-item {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .masonry-grid {
    margin-left: 0;
    margin-right: 0;
  }

  .site-main-content {
    padding: 75px 14px 40px 14px;
  }

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

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

.screen-reader-text:focus {
  background-color: #ffffff;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: #21759b;
  display: block;
  font-size: 14px;
  font-weight: bold;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}
