/*
Theme Name: O Arcanjo São Miguel
Theme URI: https://oarcanjosaomiguel.com.br
Author: Projeto O Arcanjo São Miguel
Author URI: https://oarcanjosaomiguel.com.br
Description: Tema editorial católico para o portal O Arcanjo São Miguel, com integração ao Devocionário Digital, leitura responsiva e modos claro e escuro.
Version: 0.3.0
Requires at least: 6.2
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: o-arcanjo-sao-miguel
Tags: blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, wide-blocks
*/

:root {
  --osm-bg: #f7f1e7;
  --osm-surface: #fffaf2;
  --osm-surface-2: #eadcc5;
  --osm-text: #2b2723;
  --osm-muted: #6e6258;
  --osm-title: #3b2a21;
  --osm-gold: #b99545;
  --osm-gold-strong: #8a682e;
  --osm-gold-soft: #d8be7a;
  --osm-navy: #111a2d;
  --osm-navy-2: #18243d;
  --osm-line: rgba(59,42,33,.16);
  --osm-shadow: 0 18px 55px rgba(35, 24, 17, .10);
  --osm-radius: 24px;
  --osm-content: 1180px;
  --osm-reading: 780px;
  --osm-serif: "Cormorant Garamond", Cormorant, Georgia, "Times New Roman", serif;
  --osm-sans: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --osm-bg: #0d1526;
  --osm-surface: #141f35;
  --osm-surface-2: #1b2943;
  --osm-text: #f2ebdd;
  --osm-muted: #bdb4a5;
  --osm-title: #fff6e7;
  --osm-gold: #c8a64b;
  --osm-gold-strong: #dfc77c;
  --osm-gold-soft: #5b4a24;
  --osm-navy: #080f1d;
  --osm-navy-2: #101a30;
  --osm-line: rgba(242,235,221,.16);
  --osm-shadow: 0 18px 55px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--osm-text);
  background: var(--osm-bg);
  font-family: var(--osm-sans);
  font-size: 18px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--osm-gold-strong); text-underline-offset: .18em; }
a:hover { color: var(--osm-title); }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid var(--osm-gold); outline-offset: 3px; }

.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: var(--osm-surface); clip: auto !important; clip-path: none;
  color: var(--osm-text); display: block; font-size: 16px; height: auto;
  left: 12px; padding: 14px 18px; top: 12px; width: auto; z-index: 100000;
}

.osm-container { width: min(calc(100% - 40px), var(--osm-content)); margin-inline: auto; }
.osm-reading { width: min(calc(100% - 40px), var(--osm-reading)); margin-inline: auto; }
.osm-kicker {
  color: var(--osm-gold-strong); font-size: .78rem; font-weight: 800;
  letter-spacing: .17em; text-transform: uppercase;
}
.osm-section { padding: clamp(64px, 8vw, 112px) 0; }
.osm-section--tight { padding: clamp(44px, 6vw, 76px) 0; }
.osm-section-title {
  color: var(--osm-title); font-family: var(--osm-serif); font-size: clamp(2.25rem, 5vw, 4.2rem);
  font-weight: 600; letter-spacing: -.025em; line-height: .98; margin: .35rem 0 1.25rem;
}
.osm-section-lead { color: var(--osm-muted); max-width: 720px; font-size: 1.08rem; }

.osm-button, .wp-block-button__link, input[type="submit"] {
  align-items: center; background: var(--osm-gold); border: 1px solid var(--osm-gold);
  border-radius: 999px; color: #111a2d; display: inline-flex; font-weight: 800;
  gap: .55rem; justify-content: center; line-height: 1.2; padding: .9rem 1.25rem;
  text-decoration: none; transition: transform .18s ease, background .18s ease, color .18s ease;
}
.osm-button:hover, .wp-block-button__link:hover, input[type="submit"]:hover {
  background: var(--osm-title); border-color: var(--osm-title); color: var(--osm-bg); transform: translateY(-2px);
}
.osm-button--ghost { background: transparent; border-color: currentColor; color: inherit; }
.osm-button--ghost:hover { background: rgba(255,255,255,.12); border-color: var(--osm-gold); color: #fff; }

.osm-topbar { background: var(--osm-navy); color: #f7f1e7; font-size: .83rem; }
.osm-topbar__inner { align-items: center; display: flex; gap: 1rem; justify-content: center; min-height: 38px; text-align: center; }
.osm-topbar a { color: var(--osm-gold-soft); font-weight: 800; text-decoration: none; }

.site-header {
  background: color-mix(in srgb, var(--osm-bg) 92%, transparent);
  border-bottom: 1px solid var(--osm-line); position: sticky; top: 0; z-index: 1000;
  backdrop-filter: blur(16px);
}
.admin-bar .site-header { top: 32px; }
.site-header__inner { align-items: center; display: grid; gap: 1.25rem; grid-template-columns: auto 1fr auto; min-height: 88px; }
.site-branding { align-items: center; display: flex; gap: .75rem; min-width: 0; }
.site-branding__mark {
  align-items: center; background: var(--osm-gold); border-radius: 12px; color: var(--osm-navy);
  display: inline-flex; flex: 0 0 auto; height: 42px; justify-content: center; width: 42px;
}
.site-branding__mark svg { height: 23px; width: 23px; }
.custom-logo { max-height: 58px; width: auto; }
.site-title { color: var(--osm-title); font-family: var(--osm-serif); font-size: clamp(1.65rem, 3vw, 2.25rem); font-weight: 600; line-height: .95; margin: 0; }
.site-title a { color: inherit; text-decoration: none; }
.site-description { color: var(--osm-muted); font-size: .72rem; line-height: 1.25; margin: .3rem 0 0; }

.primary-navigation { justify-self: end; }
.primary-navigation ul { align-items: center; display: flex; gap: 1.15rem; list-style: none; margin: 0; padding: 0; }
.primary-navigation a { color: var(--osm-text); font-size: .84rem; font-weight: 800; text-decoration: none; }
.primary-navigation a:hover, .primary-navigation .current-menu-item > a { color: var(--osm-gold-strong); }
.header-actions { align-items: center; display: flex; gap: .65rem; }
.osm-icon-button {
  align-items: center; background: transparent; border: 1px solid var(--osm-line); border-radius: 999px;
  color: var(--osm-text); cursor: pointer; display: inline-flex; height: 42px; justify-content: center; width: 42px;
}
.osm-icon-button:hover { border-color: var(--osm-gold); color: var(--osm-gold-strong); }
.osm-icon-button svg { height: 19px; width: 19px; }
.menu-toggle { display: none; }

.osm-hero { background: var(--osm-navy); color: #fff; min-height: 720px; overflow: hidden; position: relative; }
.osm-hero::before {
  background: linear-gradient(90deg, rgba(8,15,29,.93) 0%, rgba(8,15,29,.75) 47%, rgba(8,15,29,.28) 100%),
              url('assets/images/hero-santuario-v083.webp') center/cover no-repeat;
  content: ""; inset: 0; position: absolute;
}
.osm-hero::after {
  background: radial-gradient(circle at 72% 40%, rgba(200,166,75,.19), transparent 32%);
  content: ""; inset: 0; position: absolute;
}
.osm-hero__inner { align-items: center; display: grid; min-height: 720px; padding-block: 80px; position: relative; z-index: 2; }
.osm-hero__content { max-width: 760px; }
.osm-hero .osm-kicker { color: var(--osm-gold-soft); }
.osm-hero h1 {
  color: #fff; font-family: var(--osm-serif); font-size: clamp(3.35rem, 8vw, 7rem); font-weight: 600;
  letter-spacing: -.045em; line-height: .84; margin: .65rem 0 1.5rem; text-wrap: balance;
}
.osm-hero__lead { color: #eee6d8; font-size: clamp(1.05rem, 2.2vw, 1.35rem); max-width: 680px; }
.osm-hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.osm-hero__note { border-left: 2px solid var(--osm-gold); color: #d6cfc2; font-size: .86rem; margin-top: 2rem; padding-left: 1rem; }

.osm-paths { background: var(--osm-surface); }
.osm-grid { display: grid; gap: 1.4rem; }
.osm-grid--3 { grid-template-columns: repeat(3, 1fr); }
.osm-grid--6 { grid-template-columns: repeat(3, 1fr); }
.osm-card {
  background: var(--osm-surface); border: 1px solid var(--osm-line); border-radius: var(--osm-radius);
  box-shadow: var(--osm-shadow); color: var(--osm-text); overflow: hidden; padding: clamp(1.5rem, 3vw, 2.25rem);
  position: relative; text-decoration: none; transition: transform .2s ease, border-color .2s ease;
}
.osm-card:hover { border-color: var(--osm-gold); color: var(--osm-text); transform: translateY(-5px); }
.osm-card__number { color: var(--osm-gold-strong); font-size: .78rem; font-weight: 900; letter-spacing: .15em; }
.osm-card h3 { color: var(--osm-title); font-family: var(--osm-serif); font-size: 2rem; line-height: 1; margin: 1.5rem 0 .8rem; }
.osm-card p { color: var(--osm-muted); margin: 0; }
.osm-card__link { color: var(--osm-gold-strong); display: inline-flex; font-size: .86rem; font-weight: 800; margin-top: 1.15rem; }

.osm-devotion-card { min-height: 330px; padding-top: 3rem; }
.osm-devotion-card::before { background: var(--osm-gold); content: ""; height: 5px; inset: 0 0 auto; position: absolute; }
.osm-devotion-card__icon { align-items: center; background: var(--osm-surface-2); border-radius: 16px; color: var(--osm-gold-strong); display: flex; height: 52px; justify-content: center; width: 52px; }
.osm-devotion-card__icon svg { height: 25px; width: 25px; }

.osm-pillar-card { box-shadow: none; min-height: 210px; }
.osm-pillar-card h3 { font-size: 1.65rem; margin-top: 1.15rem; }

.osm-discernment { background: var(--osm-navy); color: #f4ecdf; }
.osm-discernment .osm-section-title { color: #fff; }
.osm-discernment .osm-section-lead { color: #c9c1b5; }
.osm-discernment-grid { display: grid; gap: 1px; grid-template-columns: repeat(4, 1fr); margin-top: 3rem; background: rgba(255,255,255,.14); }
.osm-discernment-item { background: var(--osm-navy); padding: 2rem; }
.osm-discernment-item strong { color: var(--osm-gold-soft); display: block; font-family: var(--osm-serif); font-size: 1.65rem; line-height: 1.1; margin-bottom: .65rem; }
.osm-discernment-item p { color: #c9c1b5; font-size: .92rem; margin: 0; }

.osm-feature { align-items: stretch; display: grid; grid-template-columns: 1.05fr .95fr; min-height: 560px; }
.osm-feature__image { background: url('assets/images/sao-miguel.webp') center 18%/cover no-repeat; min-height: 520px; }
.osm-feature__content { align-items: flex-start; background: var(--osm-surface-2); display: flex; flex-direction: column; justify-content: center; padding: clamp(2.3rem, 6vw, 5rem); }
.osm-feature__content h2 { color: var(--osm-title); font-family: var(--osm-serif); font-size: clamp(2.7rem, 5.5vw, 5rem); line-height: .92; margin: .6rem 0 1.2rem; }
.osm-feature__content p { color: var(--osm-muted); max-width: 620px; }

.osm-post-grid { display: grid; gap: 1.35rem; grid-template-columns: repeat(3, 1fr); margin-top: 2.5rem; }
.osm-post-card { background: var(--osm-surface); border: 1px solid var(--osm-line); border-radius: 20px; overflow: hidden; }
.osm-post-card__image { aspect-ratio: 16/10; background: var(--osm-surface-2); display: block; overflow: hidden; }
.osm-post-card__image img { height: 100%; object-fit: cover; transition: transform .35s ease; width: 100%; }
.osm-post-card:hover img { transform: scale(1.035); }
.osm-post-card__body { padding: 1.4rem; }
.osm-post-card__meta { color: var(--osm-gold-strong); font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.osm-post-card h3 { color: var(--osm-title); font-family: var(--osm-serif); font-size: 1.8rem; line-height: 1.05; margin: .7rem 0; }
.osm-post-card h3 a { color: inherit; text-decoration: none; }
.osm-post-card p { color: var(--osm-muted); font-size: .92rem; }

.osm-cta { background: linear-gradient(135deg, var(--osm-navy), var(--osm-navy-2)); color: #fff; }
.osm-cta__inner { align-items: center; display: grid; gap: 2rem; grid-template-columns: 1fr auto; }
.osm-cta h2 { color: #fff; font-family: var(--osm-serif); font-size: clamp(2.4rem, 5vw, 4.5rem); line-height: .92; margin: .3rem 0 1rem; }
.osm-cta p { color: #d4ccbf; margin: 0; max-width: 720px; }

.site-main { min-height: 50vh; }
.osm-page-hero { background: var(--osm-navy); color: #fff; padding: clamp(74px, 10vw, 132px) 0; }
.osm-page-hero h1 { color: #fff; font-family: var(--osm-serif); font-size: clamp(3rem, 7vw, 6rem); line-height: .9; margin: .6rem 0 1rem; }
.osm-page-hero p { color: #d4ccbf; max-width: 760px; }

.osm-article { padding: clamp(56px, 7vw, 96px) 0; }
.osm-article__meta { color: var(--osm-gold-strong); font-size: .78rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.osm-article__title { color: var(--osm-title); font-family: var(--osm-serif); font-size: clamp(3rem, 7vw, 5.8rem); line-height: .88; margin: .7rem 0 1rem; text-wrap: balance; }
.osm-article__excerpt { color: var(--osm-muted); font-size: 1.18rem; margin-bottom: 2rem; }
.osm-featured-image { border-radius: var(--osm-radius); box-shadow: var(--osm-shadow); display: block; margin: 2.5rem auto 3rem; overflow: hidden; width: min(calc(100% - 40px), 1040px); }
.osm-featured-image img { display: block; width: 100%; }
.entry-content { font-family: var(--osm-sans); }
.entry-content > * { margin-left: auto; margin-right: auto; max-width: var(--osm-reading); }
.entry-content > .alignwide { max-width: 1080px; }
.entry-content > .alignfull { max-width: none; }
.entry-content p, .entry-content li { font-size: 1rem; }
.entry-content p { margin-bottom: 1.35rem; }
.entry-content h2, .entry-content h3, .entry-content h4 { color: var(--osm-title); font-family: var(--osm-serif); }
.entry-content h2 { border-top: 1px solid var(--osm-line); font-size: clamp(2.15rem, 4vw, 3.35rem); line-height: 1; margin-top: 3.5rem; padding-top: 2rem; }
.entry-content h3 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.08; margin-top: 2.35rem; }
.entry-content blockquote { border-left: 5px solid var(--osm-gold); color: var(--osm-title); font-family: var(--osm-serif); font-size: 1.45rem; font-style: italic; padding: .3rem 0 .3rem 1.5rem; }
.entry-content figure { margin-bottom: 2.2rem; margin-top: 2.2rem; }
.entry-content figcaption { color: var(--osm-muted); font-size: .82rem; text-align: center; }
.entry-content table { border-collapse: collapse; display: block; margin: 2rem auto; max-width: 100%; overflow-x: auto; width: max-content; }
.entry-content th, .entry-content td { border: 1px solid var(--osm-line); min-width: 130px; padding: .85rem; text-align: left; vertical-align: top; }
.entry-content th { background: var(--osm-navy); color: #fff; }
.entry-content tbody tr:nth-child(even) { background: color-mix(in srgb, var(--osm-surface-2) 45%, transparent); }
.entry-content .wp-block-group.has-background { border-radius: 18px; padding: 1.5rem; }
.entry-content .wp-block-separator { border-color: var(--osm-line); }

.osm-post-nav { border-top: 1px solid var(--osm-line); display: grid; gap: 1.5rem; grid-template-columns: 1fr 1fr; margin-top: 4rem; padding-top: 2rem; }
.osm-post-nav a { color: var(--osm-title); display: block; font-family: var(--osm-serif); font-size: 1.5rem; line-height: 1.1; text-decoration: none; }
.osm-post-nav span { color: var(--osm-muted); display: block; font-family: var(--osm-sans); font-size: .72rem; font-weight: 800; letter-spacing: .1em; margin-bottom: .45rem; text-transform: uppercase; }
.osm-post-nav__next { text-align: right; }

.osm-archive-header { padding: clamp(64px, 8vw, 108px) 0 40px; }
.osm-archive-header h1 { color: var(--osm-title); font-family: var(--osm-serif); font-size: clamp(3rem, 7vw, 6rem); line-height: .9; margin: .5rem 0 1rem; }
.osm-pagination { margin: 3rem 0; text-align: center; }
.osm-pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.osm-pagination a, .osm-pagination span { border: 1px solid var(--osm-line); border-radius: 999px; min-width: 42px; padding: .45rem .75rem; text-decoration: none; }
.osm-pagination .current { background: var(--osm-gold); border-color: var(--osm-gold); color: var(--osm-navy); }

.search-form { display: flex; gap: .6rem; max-width: 640px; }
.search-field { background: var(--osm-surface); border: 1px solid var(--osm-line); border-radius: 999px; color: var(--osm-text); min-width: 0; padding: .85rem 1rem; width: 100%; }
.search-submit { cursor: pointer; }

.comments-area { border-top: 1px solid var(--osm-line); margin-top: 4rem; padding-top: 2rem; }
.comments-title, .comment-reply-title { color: var(--osm-title); font-family: var(--osm-serif); font-size: 2.25rem; }
.comment-list { list-style: none; padding: 0; }
.comment-body { border-bottom: 1px solid var(--osm-line); padding: 1.5rem 0; }
.comment-form input:not([type="submit"]), .comment-form textarea { background: var(--osm-surface); border: 1px solid var(--osm-line); border-radius: 12px; color: var(--osm-text); padding: .8rem; width: 100%; }

.site-footer { background: var(--osm-navy); color: #d6cfc2; padding: 64px 0 28px; }
.site-footer a { color: #f6eddc; text-decoration: none; }
.site-footer a:hover { color: var(--osm-gold-soft); }
.site-footer__grid { display: grid; gap: 2.5rem; grid-template-columns: 1.35fr .8fr .8fr; }
.site-footer h2, .site-footer h3 { color: #fff; font-family: var(--osm-serif); }
.site-footer h2 { font-size: 2.25rem; line-height: 1; margin: 0 0 1rem; }
.site-footer h3 { font-size: 1.35rem; margin-top: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: .42rem 0; }
.site-footer__bottom { border-top: 1px solid rgba(255,255,255,.14); display: flex; flex-wrap: wrap; font-size: .78rem; gap: 1rem; justify-content: space-between; margin-top: 3rem; padding-top: 1.4rem; }

@media (max-width: 1080px) {
  .site-header__inner { grid-template-columns: 1fr auto; }
  .primary-navigation { background: var(--osm-surface); border-bottom: 1px solid var(--osm-line); box-shadow: var(--osm-shadow); display: none; inset: 88px 0 auto; justify-self: stretch; padding: 1.25rem 20px; position: absolute; }
  .primary-navigation.is-open { display: block; }
  .primary-navigation ul { align-items: stretch; flex-direction: column; gap: .25rem; }
  .primary-navigation a { display: block; padding: .7rem 0; }
  .menu-toggle { display: inline-flex; }
  .header-app-button { display: none; }
  .osm-grid--6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
  .osm-container, .osm-reading { width: min(calc(100% - 28px), var(--osm-content)); }
  .site-header__inner { min-height: 76px; }
  .primary-navigation { inset: 76px 0 auto; }
  .site-description { display: none; }
  .site-title { font-size: 1.55rem; }
  .osm-hero, .osm-hero__inner { min-height: 660px; }
  .osm-hero::before { background: linear-gradient(90deg, rgba(8,15,29,.94), rgba(8,15,29,.68)), url('assets/images/hero-santuario.webp') 60% center/cover no-repeat; }
  .osm-grid--3, .osm-grid--6, .osm-post-grid, .osm-feature, .osm-cta__inner, .site-footer__grid { grid-template-columns: 1fr; }
  .osm-discernment-grid { grid-template-columns: 1fr 1fr; }
  .osm-feature__image { min-height: 480px; }
  .osm-post-nav { grid-template-columns: 1fr; }
  .osm-post-nav__next { text-align: left; }
}

@media (max-width: 520px) {
  body { font-size: 17px; }
  .osm-topbar__inner { line-height: 1.35; padding-block: 7px; }
  .site-branding__mark { height: 38px; width: 38px; }
  .theme-toggle { display: none; }
  .osm-hero h1 { font-size: clamp(3.05rem, 16vw, 4.6rem); }
  .osm-hero__actions { align-items: stretch; flex-direction: column; }
  .osm-button { width: 100%; }
  .osm-discernment-grid { grid-template-columns: 1fr; }
  .osm-card { border-radius: 18px; }
  .site-footer__bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
