/*
Theme Name: Caffè Cagliari
Theme URI: https://www.caffecagliari.it/
Author: 包装印刷365 · 模版网站
Author URI: https://www.bzys365.com/
Description: 意式咖啡烘焙品牌站主题（Torrefazione italiana）。大字号 Fjalla One 标题、深咖底色、砖红强调色、满幅图块网格；含产品自定义类型、案例/新闻、联系表单与 Newsletter 订阅。移植自同名 PbootCMS 模板，版式与配色完全一致。
Version: 1.0.0
Requires at least: 6.0
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: caffecagliari
Tags: business, blog, custom-menu, featured-images, translation-ready, one-column, two-columns
*/

/* =========================================================================
   说明：主题主样式在 assets/css/main.css（由 functions.php 通过 wp_enqueue_style 加载）。
   本文件只放 WordPress 适配补丁，加载顺序在主样式之后，用来覆盖默认行为。
   ========================================================================= */

/* ---------- 后台管理条（登录状态下的顶栏）补偿 ---------- */
.admin-bar .header { top: 32px; }
.admin-bar .drawer { top: 32px; padding-top: 142px; }

@media screen and (max-width: 782px) {
  .admin-bar .header { top: 46px; }
  .admin-bar .drawer { top: 46px; }
}

/* ---------- 全局 ---------- */
body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }
embed, iframe, object, video { max-width: 100%; }

/* ---------- 屏幕阅读器文本（WP 无障碍要求） ---------- */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  position: absolute !important;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  background: #fff;
  color: var(--ink);
  clip: auto;
  clip-path: none;
  display: block;
  font-size: 14px;
  height: auto;
  left: 6px;
  top: 6px;
  line-height: normal;
  padding: 14px 22px;
  text-decoration: none;
  width: auto;
  z-index: 100000;
}
.skip-link:focus { position: fixed; }

/* ---------- 富文本内容（后台编辑器输出） ---------- */
.rich > *:first-child { margin-top: 0; }
.rich p { margin: 0 0 1.1em; }
.rich h2 { font-family: var(--display); font-size: clamp(24px, 2.6vw, 38px); line-height: 1.1; margin: 1.6em 0 .6em; letter-spacing: .01em; }
.rich h3 { font-family: var(--display); font-size: clamp(20px, 2vw, 28px); line-height: 1.2; margin: 1.5em 0 .5em; }
.rich h4 { font-family: var(--display); font-size: 20px; margin: 1.4em 0 .4em; }
.rich ul, .rich ol { margin: 0 0 1.2em; padding-left: 1.25em; }
.rich li { margin-bottom: .5em; }
.rich blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--red);
  font-family: var(--display);
  font-size: clamp(19px, 1.8vw, 25px);
  line-height: 1.35;
}
.rich a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.rich a:hover { color: var(--red-dark); }
.rich img, .rich .wp-block-image img { border-radius: 4px; }
.rich figure { margin: 1.6em 0; }
.rich figcaption { font-size: 13px; opacity: .65; margin-top: 8px; }
.rich table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 15px; }
.rich th, .rich td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.rich th { font-family: var(--display); letter-spacing: .04em; text-transform: uppercase; font-size: 13px; }
.rich hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

/* Gutenberg 对齐类 */
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { margin-left: auto; margin-right: auto; }
.alignwide { width: min(1100px, calc(100vw - 48px)); margin-left: auto; margin-right: auto; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.wp-block-image.aligncenter img, .wp-block-image .aligncenter img { margin: 0 auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text, .gallery-caption { font-size: 13px; opacity: .65; }
.sticky { display: block; }
.bypostauthor { display: block; }

/* ---------- 分页 / 页码（WP 版 paginate_links） ---------- */
.pager a.current, .pager span.current {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.pager span.dots { padding: 0 6px; }

/* ---------- 侧栏空状态 ---------- */
.empty-tip { padding: 42px 0; text-align: center; opacity: .7; }

/* ---------- 表单提交反馈 ---------- */
.form-note {
  margin-top: 16px;
  padding: 13px 16px;
  border-left: 3px solid var(--red);
  background: rgba(220, 17, 27, .06);
  font-size: 14px;
  line-height: 1.5;
}
.form-note--ok { border-left-color: #1d7a46; background: rgba(29, 122, 70, .07); }
