/*
Theme Name: Típico de Minas Blog
Template: twentytwentyfive
Description: Tema do blog de receitas da Típico de Minas.
Version: 1.0.0
Text Domain: tipico-blog
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
:where(a) { text-underline-offset: .18em; text-decoration-thickness: 1px; }
:where(a:hover) { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--wp--preset--color--accent); outline-offset: 2px; border-radius: 4px; }
img { height: auto; }

/* ---------- Header ---------- */
.tm-topbar { font-size: .82rem; letter-spacing: .02em; }
.tm-topbar a { color: inherit; text-decoration: none; font-weight: 700; }
.tm-topbar a:hover { text-decoration: underline; }
.tm-header { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(140%) blur(8px); background: color-mix(in srgb, var(--wp--preset--color--base) 92%, transparent); border-bottom: 1px solid var(--wp--preset--color--line); }
.tm-header .wp-block-site-logo img { max-height: 56px; width: auto; }
.tm-header .wp-block-navigation a { font-weight: 600; text-decoration: none; }
.tm-header .wp-block-navigation a:hover { color: var(--wp--preset--color--primary); }
.tm-header .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--primary); }
.tm-btn-loja .wp-block-button__link { white-space: nowrap; }

/* ---------- Buttons ---------- */
.wp-block-button__link { transition: background-color .15s ease, transform .15s ease; }
.wp-block-button__link:hover { transform: translateY(-1px); }

/* ---------- Pills / chips ---------- */
.tm-pill, .taxonomy-category.tm-pill a, .tm-cat-pill a { display: inline-block; padding: .28em .8em; border-radius: 999px; background: var(--wp--preset--color--soft); color: var(--wp--preset--color--primary-dark); font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; }
.tm-cat-pill { margin: 0; }
.tm-cat-pill .wp-block-post-terms__separator { display: none; }
.tm-cat-pill a + a { margin-left: .4rem; }
.tm-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.tm-chips a { display: inline-flex; align-items: center; gap: .4rem; padding: .55em 1.05em; border-radius: 999px; background: #fff; border: 1px solid var(--wp--preset--color--line); color: var(--wp--preset--color--contrast); font-weight: 600; font-size: .92rem; text-decoration: none; transition: border-color .15s, color .15s, background .15s; }
.tm-chips a:hover { border-color: var(--wp--preset--color--primary); color: var(--wp--preset--color--primary); }

/* ---------- Cards ---------- */
.tm-card-grid .wp-block-post { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 16px; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.tm-card-grid .wp-block-post:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(70, 30, 10, .45); }
.tm-card-grid .wp-block-post-featured-image { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; }
.tm-card-grid .wp-block-post-featured-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tm-card-grid .wp-block-post:hover .wp-block-post-featured-image img { transform: scale(1.04); }
.tm-card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.tm-card-body .wp-block-post-title a { text-decoration: none; }
.tm-card-body .wp-block-post-title a:hover { color: var(--wp--preset--color--primary); }
.tm-card-body .wp-block-post-excerpt__excerpt { margin: 0; color: var(--wp--preset--color--muted); }
.tm-card-grid .wp-block-post-featured-image:not(:has(img)) { display: none; }

/* Featured (hero) post */
.tm-hero-post .wp-block-post { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 20px; overflow: hidden; }
.tm-hero-post .wp-block-post-featured-image { margin: 0; height: 100%; min-height: 320px; }
.tm-hero-post .wp-block-post-featured-image img { width: 100%; height: 100%; object-fit: cover; }
.tm-hero-post .tm-hero-body { padding: clamp(1.5rem, 4vw, 3rem); display: flex; flex-direction: column; justify-content: center; gap: .9rem; }
.tm-hero-post .wp-block-post-title a { text-decoration: none; }
@media (max-width: 781px) { .tm-hero-post .wp-block-post { grid-template-columns: 1fr; } .tm-hero-post .wp-block-post-featured-image { min-height: 220px; } }

/* Product category cards (home) */
.tm-prod-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.tm-prod-cat { position: relative; display: flex; flex-direction: column; gap: .4rem; padding: 1.4rem; border-radius: 16px; background: #fff; border: 1px solid var(--wp--preset--color--line); text-decoration: none; color: var(--wp--preset--color--contrast); transition: border-color .15s, transform .15s; }
.tm-prod-cat:hover { border-color: var(--wp--preset--color--primary); transform: translateY(-2px); }
.tm-prod-cat strong { font-family: var(--wp--preset--font-family--heading); font-size: 1.35rem; }
.tm-prod-cat span { color: var(--wp--preset--color--muted); font-size: .93rem; }
.tm-prod-cat em { font-style: normal; font-weight: 700; color: var(--wp--preset--color--primary); margin-top: .3rem; }
@media (max-width: 781px) { .tm-prod-cats { grid-template-columns: 1fr; } }

/* ---------- Single post ---------- */
.tm-breadcrumbs { font-size: .85rem; color: var(--wp--preset--color--muted); }
.tm-breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.tm-breadcrumbs li + li::before { content: "›"; margin-right: .35rem; opacity: .6; }
.tm-breadcrumbs a { color: inherit; text-decoration: none; }
.tm-breadcrumbs a:hover { color: var(--wp--preset--color--primary); }
.tm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.1rem; color: var(--wp--preset--color--muted); font-size: .92rem; }
.tm-single-hero .wp-block-post-featured-image img { border-radius: 20px; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }

.tm-recipe-nav { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1.5rem; }
.tm-recipe-nav a { display: inline-flex; align-items: center; gap: .4rem; padding: .6em 1.1em; border-radius: 999px; background: var(--wp--preset--color--primary); color: #fff; font-weight: 700; text-decoration: none; font-size: .95rem; }
.tm-recipe-nav a.tm-alt { background: #fff; color: var(--wp--preset--color--primary); border: 1px solid var(--wp--preset--color--primary); }
.tm-recipe-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin: 0 0 1.6rem; padding: 1rem 1.2rem; border-radius: 14px; background: var(--wp--preset--color--soft); font-size: .95rem; }
.tm-recipe-facts b { font-family: var(--wp--preset--font-family--heading); font-size: 1.25rem; margin-right: .25rem; color: var(--wp--preset--color--primary-dark); }

.entry-content > p:first-child { font-size: 1.15rem; line-height: 1.65; }
.tm-section { margin: 2.2rem 0; padding: clamp(1.2rem, 3vw, 2rem); border-radius: 18px; scroll-margin-top: 100px; }
.tm-section h2 { margin-top: 0 !important; font-size: clamp(1.5rem, 3vw, 1.9rem); display: flex; align-items: center; gap: .6rem; }
.tm-ingredients { background: #fff; border: 1px solid var(--wp--preset--color--line); box-shadow: 0 10px 30px -24px rgba(70, 30, 10, .5); }
.tm-ingredients ul, .tm-ingredients ol { list-style: none; margin: 0; padding: 0; columns: 2 260px; column-gap: 2rem; }
.tm-ingredients li { break-inside: avoid; position: relative; padding: .55rem 0 .55rem 2.1rem; border-bottom: 1px dashed var(--wp--preset--color--line); cursor: pointer; user-select: none; }
.tm-ingredients li::before { content: ""; position: absolute; left: 0; top: .72rem; width: 1.15rem; height: 1.15rem; border-radius: 5px; border: 2px solid var(--wp--preset--color--primary); background: #fff; transition: background .15s; }
.tm-ingredients li.is-checked { color: var(--wp--preset--color--muted); text-decoration: line-through; }
.tm-ingredients li.is-checked::before { background: var(--wp--preset--color--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 80% no-repeat; }
.tm-ingredients .tm-hint { font-size: .85rem; color: var(--wp--preset--color--muted); margin: -.4rem 0 1rem; }
.tm-ingredients p.tm-subhead { font-weight: 700; margin: 1rem 0 .3rem; column-span: all; }
.tm-steps { background: var(--wp--preset--color--soft); }
.tm-steps ol, .tm-steps ul { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.tm-steps li { counter-increment: step; position: relative; padding: .2rem 0 1.3rem 3.4rem; line-height: 1.7; }
.tm-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--wp--preset--color--primary); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 1rem; }
.tm-steps li:not(:last-child)::after { content: ""; position: absolute; left: 1.12rem; top: 2.6rem; bottom: .4rem; width: 2px; background: color-mix(in srgb, var(--wp--preset--color--primary) 25%, transparent); }
.tm-steps .tm-step-title { display: block; font-weight: 800; margin-bottom: .15rem; }
.tm-steps p.tm-subhead { font-weight: 700; margin: 1rem 0 .4rem; }
.entry-content a.tm-prod-link { color: var(--wp--preset--color--primary); font-weight: 600; }

/* Product box */
.tm-products { margin: 2.6rem 0; padding: clamp(1.2rem, 3vw, 2rem); border-radius: 18px; background: linear-gradient(135deg, var(--wp--preset--color--primary-dark), var(--wp--preset--color--primary)); color: #fff; }
.tm-products h2 { color: #fff; margin: 0 0 .3rem; font-size: clamp(1.4rem, 3vw, 1.8rem); }
.tm-products > p { margin: 0 0 1.2rem; opacity: .92; }
.tm-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.tm-product { display: flex; flex-direction: column; background: #fff; color: var(--wp--preset--color--contrast); border-radius: 14px; overflow: hidden; text-decoration: none; transition: transform .15s ease; }
.tm-product:hover { transform: translateY(-3px); }
.tm-product img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; padding: .6rem; }
.tm-product-body { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; border-top: 1px solid var(--wp--preset--color--line); }
.tm-product-brand { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--wp--preset--color--muted); }
.tm-product-name { font-weight: 700; line-height: 1.3; font-size: .95rem; }
.tm-product-price { font-family: var(--wp--preset--font-family--heading); font-size: 1.3rem; color: var(--wp--preset--color--primary-dark); margin-top: auto; }
.tm-product-cta { display: block; text-align: center; padding: .55rem; border-radius: 10px; background: var(--wp--preset--color--primary); color: #fff; font-weight: 700; font-size: .9rem; }
.tm-products .tm-more { display: inline-block; margin-top: 1.1rem; color: #fff; font-weight: 700; }

/* About / brand box */
.tm-about { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: center; padding: 1.4rem; border-radius: 18px; border: 1px solid var(--wp--preset--color--line); background: #fff; }
.tm-about img { width: 84px; height: 84px; object-fit: contain; }
.tm-about p { margin: .3rem 0 0; color: var(--wp--preset--color--muted); }
@media (max-width: 600px) { .tm-about { grid-template-columns: 1fr; text-align: center; } .tm-about img { margin: 0 auto; } }

/* Related */
.tm-related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.tm-related a { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--wp--preset--color--contrast); transition: transform .15s; }
.tm-related a:hover { transform: translateY(-3px); }
.tm-related img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.tm-related span { padding: .8rem 1rem 1rem; font-family: var(--wp--preset--font-family--heading); font-weight: 600; font-size: 1.1rem; line-height: 1.3; }
@media (max-width: 781px) { .tm-related { grid-template-columns: 1fr; } }

/* Archive intro */
.tm-archive-intro .wp-block-term-description p { max-width: 62ch; font-size: 1.1rem; color: var(--wp--preset--color--muted); }

/* Footer */
.tm-footer a { color: inherit; text-decoration: none; }
.tm-footer a:hover { text-decoration: underline; }
.tm-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }

/* Search */
.wp-block-search__input { border-radius: 999px !important; padding: .7em 1.1em !important; border: 1px solid var(--wp--preset--color--line) !important; background: #fff; }
.wp-block-search__button { border-radius: 999px !important; }

/* Print: só a receita */
@media print {
  .tm-topbar, .tm-header, .tm-footer, .tm-products, .tm-related-wrap, .tm-recipe-nav, .tm-about, .tm-breadcrumbs { display: none !important; }
  .tm-section { box-shadow: none; border: 1px solid #ccc; }
}

/* Mobile header */
@media (max-width: 600px) {
  .tm-brand-text { display: none !important; }
  .tm-topbar p { font-size: .74rem; line-height: 1.35; }
  .tm-header .wp-block-site-logo img { max-height: 46px; }
  .tm-btn-loja .wp-block-button__link { padding: .5em .95em !important; font-size: .85rem; }
}
.tm-hero-post .wp-block-post:not(:has(.wp-block-post-featured-image)) { grid-template-columns: 1fr; }
