/*
Theme Name: Viva España
Theme URI: https://vivaespan.com/
Author: Viva España
Description: Самостоятельная адаптивная журнальная тема для сайта Viva España.
Version: 2.1.5
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: viva-espana
*/

:root {
  --ve-red: #ae2830;
  --ve-red-dark: #8f1f26;
  --ve-gold: #e0aa2e;
  --ve-charcoal: #2c2b29;
  --ve-nav: #20201f;
  --ve-bg: #e9ded7;
  --ve-paper: #fff;
  --ve-text: #302d2a;
  --ve-muted: #736d67;
  --ve-border: #ded4cc;
  --ve-width: 1760px;
  --ve-gap: clamp(18px, 1.5vw, 30px);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { margin: 0; background: var(--ve-bg); color: var(--ve-text); font-family: Arial, Helvetica, sans-serif; line-height: 1.6; overflow-wrap: anywhere; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--ve-red); text-decoration: none; }
a:hover, a:focus { color: var(--ve-red-dark); text-decoration: underline; }
button, input, textarea, select { font: inherit; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { position: fixed; z-index: 99999; top: 10px; left: 10px; width: auto; height: auto; padding: 12px 16px; clip: auto; background: #fff; color: #111; }

.site { min-height: 100vh; }
.ve-shell { width: min(100%, var(--ve-width)); margin-inline: auto; }
.site-header { background: var(--ve-charcoal); color: #fff; border-top: 6px solid var(--ve-red); }
.site-header::before { content: ""; display: block; width: 34%; height: 6px; margin: -6px auto 0; background: var(--ve-gold); }
.header-inner { min-height: clamp(170px, 17vw, 310px); padding: clamp(28px, 4vw, 70px) clamp(22px, 5vw, 92px); display: flex; align-items: center; gap: clamp(24px, 3vw, 52px); }
.custom-logo-link { flex: 0 0 auto; }
.custom-logo { width: clamp(110px, 11vw, 195px); max-height: 195px; object-fit: contain; }
.site-branding { min-width: 0; }
.site-title { margin: 0; color: #fff; font-size: clamp(2.1rem, 4.2vw, 5rem); font-weight: 400; line-height: 1; letter-spacing: .01em; }
.site-title a { color: inherit; text-decoration: none; }
.site-description { margin: 14px 0 0; color: #ddd6d0; font-size: clamp(.9rem, 1.2vw, 1.15rem); }

.main-navigation { position: relative; background: var(--ve-nav); border-bottom: 6px solid var(--ve-red); }
.menu-toggle { display: none; width: 100%; min-height: 54px; padding: 12px 20px; border: 0; background: var(--ve-nav); color: #fff; text-align: left; font-weight: 700; cursor: pointer; }
.primary-menu, .primary-menu ul { margin: 0; padding: 0; list-style: none; }
.primary-menu { display: flex; flex-wrap: wrap; align-items: stretch; padding-inline: clamp(12px, 3vw, 52px); }
.primary-menu li { position: relative; }
.submenu-toggle { position: absolute; z-index: 2; top: 12px; right: 2px; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; background: transparent; color: #fff; cursor: pointer; }
.submenu-toggle::before { content: "⌄"; font-size: 1.25rem; line-height: 1; transition: transform .2s ease; }
.submenu-toggle[aria-expanded="true"]::before { transform: rotate(180deg); }
.menu-item-has-children > a, .cat-parent > a { padding-right: 46px !important; }
.primary-menu > li > a { display: flex; align-items: center; min-height: 68px; padding: 12px clamp(14px, 1.45vw, 28px); color: #fff; font-size: clamp(.82rem, 1vw, 1.05rem); font-weight: 700; line-height: 1.25; text-transform: uppercase; }
.primary-menu > li.current-menu-item > a, .primary-menu > li.current_page_item > a, .primary-menu > li > a:hover, .primary-menu > li > a:focus { background: var(--ve-red); color: #fff; text-decoration: none; }
.primary-menu .sub-menu, .primary-menu .children { position: absolute; z-index: 20; top: 100%; left: 0; display: none; min-width: 230px; background: var(--ve-nav); box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.primary-menu li:hover > .sub-menu, .primary-menu li:focus-within > .sub-menu, .primary-menu li:hover > .children, .primary-menu li:focus-within > .children { display: block; }
.primary-menu li.submenu-open > .sub-menu, .primary-menu li.submenu-open > .children { display: block; }
.primary-menu .sub-menu a, .primary-menu .children a { display: block; padding: 12px 16px; color: #fff; }
.primary-menu .sub-menu a:hover, .primary-menu .sub-menu a:focus, .primary-menu .children a:hover, .primary-menu .children a:focus { background: var(--ve-red); text-decoration: none; }

.site-content { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 23vw, 390px); gap: var(--ve-gap); padding: clamp(22px, 2.2vw, 42px) clamp(16px, 3.4vw, 62px) 50px; }
.content-area { min-width: 0; }
.page-header, .single-post, .page-content, .comments-area, .not-found { background: var(--ve-paper); border: 1px solid var(--ve-border); padding: clamp(20px, 2.5vw, 42px); }
.page-header { margin-bottom: var(--ve-gap); }
.page-title { margin: 0; font-size: clamp(1.65rem, 2.4vw, 2.5rem); line-height: 1.2; }

.posts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ve-gap); align-items: start; }
.post-card { min-width: 0; background: var(--ve-paper); border: 1px solid var(--ve-border); }
.post-card-image { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(145deg, var(--ve-red), var(--ve-gold)); }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.post-card-image:hover img { transform: scale(1.025); }
.post-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: rgba(255,255,255,.9); font-size: clamp(1.8rem, 4vw, 4rem); font-weight: 700; letter-spacing: .05em; }
.post-card-body { padding: clamp(18px, 2vw, 30px); }
.post-category { display: inline-block; margin-bottom: 12px; padding: 5px 12px; border-radius: 999px; background: var(--ve-gold); color: #241d13; font-size: .75rem; font-weight: 700; line-height: 1.4; text-transform: uppercase; }
.post-card-title { margin: 0 0 10px; color: var(--ve-red); font-size: clamp(1.25rem, 1.65vw, 1.85rem); font-weight: 400; line-height: 1.28; }
.post-card-title a { color: inherit; }
.post-meta { color: var(--ve-muted); font-size: .85rem; }
.post-excerpt { margin-top: 14px; }
.post-excerpt p { margin: 0; }
.read-more { display: inline-block; margin-top: 16px; font-weight: 700; }

.widget-area { min-width: 0; }
.widget { margin: 0 0 var(--ve-gap); padding: clamp(18px, 1.8vw, 28px); background: var(--ve-paper); border: 1px solid var(--ve-border); }
.widget-title { margin: 0 0 16px; font-family: Georgia, serif; font-size: 1.5rem; line-height: 1.25; }
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li { padding: 9px 0; border-bottom: 1px solid var(--ve-border); }
.widget li:last-child { border-bottom: 0; }
.search-form { display: flex; }
.search-field { min-width: 0; width: 100%; height: 50px; padding: 10px 13px; border: 1px solid var(--ve-border); background: #fff; color: var(--ve-text); }
.search-submit { flex: 0 0 auto; min-height: 50px; padding: 10px 18px; border: 0; background: var(--ve-red); color: #fff; font-weight: 700; cursor: pointer; }
.search-submit:hover, .search-submit:focus { background: var(--ve-red-dark); }
.widget .wp-block-search__label { display: block; margin-bottom: 8px; }
.widget .wp-block-search__inside-wrapper { display: flex; align-items: stretch; }
.widget .wp-block-search__input { min-width: 0; width: 100%; height: 50px; padding: 10px 13px; border: 1px solid var(--ve-border); }
.widget .wp-block-search__button { flex: 0 0 auto; width: auto !important; min-width: max-content; height: 50px; margin: 0; padding: 10px 16px; border: 0; background: var(--ve-red); color: #fff; line-height: 1; white-space: nowrap; word-break: normal; overflow-wrap: normal; cursor: pointer; }
.widget .wp-block-search__button:hover, .widget .wp-block-search__button:focus { background: var(--ve-red-dark); }
.calendar_wrap { overflow-x: auto; }
#wp-calendar { width: 100%; border-collapse: collapse; text-align: center; }
#wp-calendar caption { margin-bottom: 10px; font-weight: 700; }
#wp-calendar th, #wp-calendar td { padding: 7px 3px; border: 1px solid var(--ve-border); }

.navigation.pagination { grid-column: 1 / -1; margin-top: 28px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 7px 12px; background: var(--ve-paper); border: 1px solid var(--ve-border); }
.page-numbers.current { background: var(--ve-red); border-color: var(--ve-red); color: #fff; }

.entry-header { margin-bottom: 24px; }
.entry-title { margin: 0 0 12px; font-size: clamp(1.8rem, 3vw, 3.2rem); line-height: 1.18; }
.entry-content { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1rem, 1.15vw, 1.18rem); }
.entry-content::after { content: ""; display: table; clear: both; }
.entry-content p { overflow: visible; }
.entry-content img.alignleft,
.entry-content figure.alignleft,
.entry-content .wp-block-image.alignleft { float: left !important; clear: none !important; display: block; width: auto; max-width: 50%; margin: .35em 1.5em 1em 0 !important; }
.entry-content img.alignright,
.entry-content figure.alignright,
.entry-content .wp-block-image.alignright { float: right !important; clear: none !important; display: block; width: auto; max-width: 50%; margin: .35em 0 1em 1.5em !important; }
.entry-content .aligncenter { display: block; margin: 1.2em auto; }
.entry-content .wp-caption { max-width: 100%; }
.entry-content .wp-caption-text, .entry-content figcaption { margin-top: .45em; color: var(--ve-muted); font-family: Arial, Helvetica, sans-serif; font-size: .82rem; line-height: 1.4; }
.entry-content > * { max-width: 880px; }
.entry-content > .alignwide { max-width: 1200px; }
.entry-content > .alignfull { max-width: none; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); width: 100vw; }
.entry-content h2, .entry-content h3 { line-height: 1.25; }
.entry-content blockquote { margin-inline: 0; padding: 12px 24px; border-left: 5px solid var(--ve-gold); background: #f7f2ee; }
.featured-image { margin: 0 0 28px; }
.featured-image img { width: 100%; }
.post-navigation { margin-top: var(--ve-gap); }
.post-navigation .nav-links { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.post-navigation .nav-next { text-align: right; }
.post-navigation a { display: flex; flex-direction: column; justify-content: center; min-height: 82px; padding: 15px 20px; border: 2px solid #fff; border-top: 6px solid var(--ve-gold); background: var(--ve-red); color: #fff !important; font-weight: 700; line-height: 1.35; box-shadow: 0 4px 0 var(--ve-red-dark), 0 5px 14px rgba(0,0,0,.28); transition: background .2s ease, transform .2s ease; }
.post-navigation .nav-next a { align-items: flex-end; }
.post-navigation a:hover, .post-navigation a:focus { background: var(--ve-red-dark); color: #fff !important; text-decoration: none; transform: translateY(-2px); }
.post-navigation .nav-subtitle { display: block; margin-bottom: 4px; color: #ffe5a6; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.post-navigation .nav-title { display: block; }

.comments-area { margin-top: var(--ve-gap); }
.comment-list { margin: 0 0 30px; padding-left: 24px; }
.comment-form p { margin: 0 0 18px; }
.comment-form label { display: block; margin: 0 0 7px; font-weight: 700; }
.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] { display: block; width: 100%; max-width: 760px; padding: 11px 13px; border: 1px solid var(--ve-border); background: #fff; color: var(--ve-text); }
.comment-form textarea { min-height: 220px; resize: vertical; }
.comment-form .submit { min-height: 46px; padding: 10px 18px; border: 0; background: var(--ve-red); color: #fff; font-weight: 700; cursor: pointer; }
.comment-form .submit:hover, .comment-form .submit:focus { background: var(--ve-red-dark); }

.site-footer { background: var(--ve-charcoal); color: #ddd6d0; border-top: 6px solid var(--ve-red); }
.footer-inner { padding: 28px clamp(18px, 3.4vw, 62px); text-align: center; }
.site-footer a { color: #fff; }

@media (max-width: 1050px) {
  .site-content { grid-template-columns: 1fr; }
  .widget-area { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ve-gap); }
  .widget { margin: 0; }
}

@media (max-width: 760px) {
  .header-inner { min-height: 145px; padding: 24px 18px; }
  .site-description { display: none; }
  .menu-toggle { display: block; }
  .primary-menu { display: none; padding: 0; }
  .main-navigation.toggled .primary-menu { display: block; }
  .primary-menu > li > a { min-height: 48px; padding: 12px 18px; }
  .primary-menu .sub-menu, .primary-menu .children { position: static; display: none; box-shadow: none; padding-left: 18px; }
  .primary-menu li.submenu-open > .sub-menu, .primary-menu li.submenu-open > .children { display: block; }
  .submenu-toggle { top: 3px; right: 4px; }
  .posts-grid { gap: 18px; }
  .post-card-body { padding: 18px; }
}

@media (max-width: 560px) {
  .custom-logo { width: 82px; }
  .site-title { font-size: clamp(1.8rem, 10vw, 2.5rem); }
  .site-content { padding-inline: 12px; }
  .posts-grid, .widget-area, .post-navigation .nav-links { grid-template-columns: 1fr; }
  .post-card-image { aspect-ratio: 16 / 10; }
  .entry-content img.alignleft, .entry-content figure.alignleft, .entry-content .wp-block-image.alignleft,
  .entry-content img.alignright, .entry-content figure.alignright, .entry-content .wp-block-image.alignright { float: none !important; display: block; width: auto; max-width: 100%; margin: 1.2em auto !important; }
}
