/*
Theme Name: Mansour Theme B
Theme URI: https://mansourforouzesh.com/
Author: Mansour Forouzesh
Description: A minimal, plugin-independent classic WordPress theme for Mansour Forouzesh. Displays the real WordPress front-page content and supports Mansour Studio without depending on it.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mansour-theme-b
Tags: portfolio, photography, one-column, custom-menu, featured-images, wide-blocks
*/

:root {
  --mtb-bg: #ffffff;
  --mtb-ink: #181818;
  --mtb-muted: #737373;
  --mtb-line: #e6e6e6;
  --mtb-max: 1320px;
  --mtb-reading: 780px;
  --mtb-edge: clamp(20px, 4vw, 72px);
  --mtb-gap: clamp(24px, 4.6vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--mtb-bg); color: var(--mtb-ink); }
body.mtb-theme-b { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body.mtb-theme-b img, body.mtb-theme-b video, body.mtb-theme-b iframe { max-width: 100%; }
body.mtb-theme-b img { height: auto; }
body.mtb-theme-b a { overflow-wrap: anywhere; }
body.mtb-theme-b :focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
body.admin-bar .mtb-header { top: 32px; }

/* All visual layout below is scoped to our own theme markup. Studio-managed
   templates render their own document and are intentionally left untouched. */
.mtb-skip { position: absolute; z-index: 9999; left: 12px; top: -100px; padding: 12px 18px; color: #fff; background: #111; text-decoration: none; }
.mtb-skip:focus { top: 12px; }
.mtb-header { width: 100%; border-bottom: 1px solid var(--mtb-line); background: #fff; }
.mtb-header-inner { max-width: calc(var(--mtb-max) + var(--mtb-edge) * 2); padding: 25px var(--mtb-edge); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 40px; }
.mtb-brand { color: var(--mtb-ink); text-decoration: none; font-size: clamp(17px, 1.5vw, 20px); font-weight: 650; letter-spacing: -.045em; line-height: 1.2; }
.mtb-brand img { max-width: 240px; max-height: 72px; width: auto; height: auto; }
.mtb-nav { margin-left: auto; }
.mtb-nav .menu { padding: 0; margin: 0; list-style: none; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 30px; }
.mtb-nav .menu-item { position: relative; list-style: none; }
.mtb-nav a { display: block; color: var(--mtb-ink); text-decoration: none; font-size: 13px; font-weight: 500; line-height: 1.55; letter-spacing: .01em; }
.mtb-nav a:hover, .mtb-nav .current-menu-item > a, .mtb-nav .current_page_item > a { text-decoration: underline; text-underline-offset: 5px; }
.mtb-nav .sub-menu { display: none; min-width: 175px; z-index: 15; position: absolute; left: -15px; top: 100%; padding: 12px 15px; margin: 0; background: #fff; border: 1px solid var(--mtb-line); list-style: none; }
.mtb-nav .sub-menu li + li { margin-top: 10px; }
.mtb-nav li:hover > .sub-menu, .mtb-nav li:focus-within > .sub-menu { display: block; }
.mtb-menu-mobile { display: none; margin-left: auto; }
.mtb-menu-mobile summary { cursor: pointer; list-style: none; font-size: 14px; padding: 10px 0 10px 15px; }
.mtb-menu-mobile summary::-webkit-details-marker { display: none; }
.mtb-menu-mobile[open] .mtb-mobile-panel { display: block; }
.mtb-mobile-panel { position: absolute; z-index: 25; left: 0; right: 0; margin-top: 18px; padding: 16px var(--mtb-edge) 24px; background: #fff; border-bottom: 1px solid var(--mtb-line); box-shadow: 0 16px 24px #0000000b; }
.mtb-mobile-panel .menu { margin: 0; padding: 0; list-style: none; }
.mtb-mobile-panel .menu li { list-style: none; }
.mtb-mobile-panel .menu a { text-decoration: none; color: var(--mtb-ink); padding: 11px 0; display: block; border-bottom: 1px solid var(--mtb-line); }
.mtb-mobile-panel .sub-menu { padding-left: 16px; list-style: none; }

.mtb-main { width: 100%; max-width: calc(var(--mtb-max) + var(--mtb-edge) * 2); margin: 0 auto; min-height: 40vh; padding: clamp(36px, 5vw, 78px) var(--mtb-edge) clamp(64px, 9vw, 135px); }
.mtb-main--front { padding-top: clamp(20px, 4vw, 64px); }
.mtb-page { width: 100%; min-width: 0; }
.mtb-page-head { margin: 0 0 clamp(30px, 5vw, 64px); }
.mtb-kicker { color: var(--mtb-muted); letter-spacing: .13em; font-size: 11px; font-weight: 600; text-transform: uppercase; margin: 0 0 16px; }
.mtb-page-title { margin: 0; font-weight: 500; line-height: 1.1; letter-spacing: -.045em; font-size: clamp(36px, 6vw, 84px); overflow-wrap: anywhere; }
.mtb-entry { color: var(--mtb-ink); font-size: clamp(16px, 1.23vw, 18px); line-height: 1.75; overflow-wrap: break-word; }
.mtb-entry::after { content: ''; display: block; clear: both; }
.mtb-entry > :where(p, h2, h3, h4, h5, h6, ul, ol, blockquote, pre, table) { max-width: var(--mtb-reading); }
.mtb-entry > :where(p, ul, ol, blockquote) { margin-top: 0; margin-bottom: 1.5em; }
.mtb-entry :where(h1, h2, h3, h4, h5, h6) { line-height: 1.18; letter-spacing: -.03em; font-weight: 550; }
.mtb-entry h2 { font-size: clamp(28px, 3.5vw, 50px); margin: 2em 0 .55em; }
.mtb-entry h3 { font-size: clamp(22px, 2.4vw, 32px); margin: 1.7em 0 .6em; }
.mtb-entry h4 { font-size: clamp(19px, 2vw, 24px); }
.mtb-entry a { color: inherit; text-underline-offset: .18em; }
.mtb-entry a:hover { text-decoration-thickness: 2px; }
.mtb-entry figure { margin: 32px 0; }
.mtb-entry figure img, .mtb-entry .wp-block-image img { display: block; max-width: 100%; }
.mtb-entry figcaption { font-size: 12px; line-height: 1.6; color: var(--mtb-muted); margin-top: 12px; }
.mtb-entry blockquote { margin-left: 0; border-left: 2px solid var(--mtb-ink); padding-left: 25px; font-size: 1.12em; }
.mtb-entry hr { height: 1px; border: 0; background: var(--mtb-line); margin: 3em 0; }
.mtb-entry table { border-collapse: collapse; width: 100%; }
.mtb-entry th, .mtb-entry td { border-bottom: 1px solid var(--mtb-line); text-align: left; padding: 12px; }
.mtb-entry pre { white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: auto; padding: 20px; background: #f5f5f5; }
.mtb-entry .alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }
.mtb-entry .alignfull { width: 100%; max-width: none; }
.mtb-entry .wp-block-gallery, .mtb-entry .blocks-gallery-grid { max-width: none; }
.mtb-entry .wp-block-columns { display: flex; gap: 30px; }
.mtb-entry .wp-block-column { flex: 1; min-width: 0; }
.mtb-entry .wp-block-cover { min-height: 340px; }
.mtb-entry .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.mtb-entry .wp-block-button__link { display: inline-block; border-radius: 0; background: #161616; color: white; padding: 12px 25px; text-decoration: none; }
.mtb-entry :where(.wp-block-image, .wp-block-gallery, .wp-block-columns, .wp-block-cover) { max-width: none; }
.mtb-entry .wp-block-image img, .mtb-entry .wp-block-gallery img { max-height: none; }

/* Studio's portable HTML is deliberately plain markup. When the plugin is off,
   these rules make the saved images, sections, and galleries legible without JS. */
.mtb-entry .mf-native-content { width: 100%; max-width: 100%; min-width: 0; }
.mtb-entry .mf-native-content :where(img, video) { display: block; max-width: 100%; height: auto; }
.mtb-entry .mf-native-content :where(.mf-photo-gallery, .mf-studio-gallery, .mfs-gallery, .mf-ed-gallery, .mfv-gallery) { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 22px; }
.mtb-entry .mf-native-content :where(.mf-photo-gallery, .mf-studio-gallery, .mfs-gallery, .mf-ed-gallery, .mfv-gallery) > figure { min-width: 0; margin: 0; }
.mtb-entry .mf-native-content :where(.mf-photo-hero, .mfs-cover, .mfs-hero) img { max-height: min(75vh, 920px); object-fit: contain; object-position: left center; }
.mtb-entry .mf-native-content :where(.mf-photo-text-section, .mfs-section, .mf-art-core-panel, .mf-ed-section) { margin-block: clamp(35px, 6vw, 75px); }
.mtb-entry .mf-native-content :where(.mf-photo-facts, .mfs-facts, .mf-photo-records) { display: grid; gap: 14px; }
.mtb-entry .mf-native-content :where(.mf-photo-fact, .mf-photo-record) { display: flex; flex-wrap: wrap; gap: 6px 20px; border-bottom: 1px solid var(--mtb-line); padding: 9px 0; }
.mtb-entry .mf-native-content :where(.mf-photo-fact small, .mf-photo-record small) { color: var(--mtb-muted); }
.mtb-entry .mf-native-content :where(.mf-photo-heading, .mfs-heading) { margin-block: 25px 48px; }
.mtb-entry .mf-native-content :where(.mf-photo-heading h1, .mfs-heading h1) { font-size: clamp(35px, 6vw, 78px); }


/* Studio's explicit native-WordPress view calls get_header/get_footer rather
   than the classic theme page template. Keep its page legible as well. */
body.mtb-theme-b .mf-native-wordpress {
  max-width: calc(var(--mtb-max) + 2 * var(--mtb-edge));
  min-height: 40vh;
  padding: clamp(32px, 5vw, 75px) var(--mtb-edge) clamp(65px, 8vw, 120px);
  margin-inline: auto;
  line-height: 1.7;
  overflow-wrap: break-word;
}
body.mtb-theme-b .mf-native-wordpress > h1 {
  font-size: clamp(32px, 6vw, 74px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.04em;
  margin-top: 0;
}
body.mtb-theme-b .mf-native-wordpress img { max-width: 100%; height: auto; }
body.mtb-theme-b .mf-native-wordpress figure { margin-inline: 0; }
body.mtb-theme-b .mf-native-wordpress figcaption { color: var(--mtb-muted); font-size: 12px; }

.mtb-posts { display: grid; gap: 32px; margin-top: 40px; }
.mtb-post-card { padding: 0 0 30px; border-bottom: 1px solid var(--mtb-line); }
.mtb-post-card h2 { font-size: clamp(26px, 3.3vw, 44px); line-height: 1.2; letter-spacing: -.03em; font-weight: 500; margin: 7px 0 10px; }
.mtb-post-card h2 a { color: inherit; text-decoration: none; }
.mtb-post-card h2 a:hover { text-decoration: underline; }
.mtb-post-date { font-size: 12px; color: var(--mtb-muted); }
.mtb-post-excerpt { max-width: var(--mtb-reading); font-size: 16px; line-height: 1.65; }
.mtb-pagination { margin-top: 50px; }
.mtb-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 15px; }
.mtb-pagination a, .mtb-pagination span { color: var(--mtb-ink); }
.mtb-footer { border-top: 1px solid var(--mtb-line); background: white; }
.mtb-footer-inner { max-width: calc(var(--mtb-max) + var(--mtb-edge) * 2); padding: 35px var(--mtb-edge) 45px; margin: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.mtb-footer a { color: var(--mtb-ink); text-decoration: none; }
.mtb-footer a:hover { text-decoration: underline; }
.mtb-footer-note { color: var(--mtb-muted); font-size: 12px; }
.mtb-footer-menu { display: flex; flex-wrap: wrap; gap: 12px 22px; padding: 0; margin: 0; list-style: none; font-size: 12px; }
.mtb-empty { padding: 38px 0; font-size: 16px; color: var(--mtb-muted); }
.mtb-error { font-size: 20px; max-width: 680px; }
.mtb-form { display: flex; gap: 8px; max-width: 530px; }
.mtb-form input[type="search"] { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid #aaa; border-radius: 0; font: inherit; }
.mtb-form button { padding: 12px 19px; border: 1px solid #181818; color: #fff; background: #181818; cursor: pointer; font: inherit; }
.mtb-comments { margin-top: 65px; max-width: var(--mtb-reading); }
.mtb-comments input, .mtb-comments textarea { max-width: 100%; }
.mtb-comments .comment-list { padding-left: 18px; }
.mtb-comments .comment { margin-bottom: 20px; }
.mtb-edit-link { display: inline-block; font-size: 12px; color: var(--mtb-muted); margin-top: 30px; }
.mtb-woocommerce { padding-block: 40px 100px; }
.mtb-visually-hidden { position: absolute !important; height: 1px !important; width: 1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; }

@media (max-width: 960px) {
  .mtb-header-inner { padding-block: 20px; }
  .mtb-nav { display: none; }
  .mtb-menu-mobile { display: block; }
}
@media (max-width: 782px) {
  body.admin-bar .mtb-header { top: 46px; }
  .mtb-entry .wp-block-columns { flex-wrap: wrap; }
  .mtb-entry .wp-block-columns > .wp-block-column { flex-basis: 100%; }
  .mtb-page-title { font-size: clamp(32px, 8vw, 64px); }
}
@media (max-width: 480px) {
  .mtb-main { padding-top: 32px; padding-bottom: 64px; }
  .mtb-main--front { padding-top: 20px; }
  .mtb-header-inner { padding-block: 18px; }
  .mtb-entry { line-height: 1.65; }
  .mtb-entry .mf-native-content :where(.mf-photo-gallery, .mf-studio-gallery, .mfs-gallery, .mf-ed-gallery, .mfv-gallery) { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
