/*
Theme Name: Fewer
Theme URI: https://wordpress.com/theme/fewer
Author: Automattic
Author URI: https://automattic.com
Description: Fewer is perfect for showcasing portfolios and blogs. With a clean and opinionated design, it offers excellent typography and style variations that make it easy to present your work or business. The theme is highly versatile, making it ideal for bloggers and businesses alike, and it offers a range of customizable options that allow you to tailor your site to your specific needs.
Requires at least: 5.8
Tested up to: 6.2
Requires PHP: 5.7
Version: 19.0.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fewer
Tags: blog, news, portfolio, grid-layout, two-columns, three-columns, left-sidebar, wide-blocks, block-patterns, custom-colors, custom-header, custom-logo, custom-menu, editor-style, featured-images, full-site-editing, rtl-language-support, style-variations, template-editing, theme-options, threaded-comments, translation-ready
*/

/*
 * Font smoothing
 * https://github.com/WordPress/gutenberg/issues/35934
 */
body {
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
}

/*
 * Control the hover stylings of outline block style.
 * Unnecessary once block styles are configurable via theme.json
 * https://github.com/WordPress/gutenberg/issues/42794
 */
.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background):hover {
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--background);
	border-color: var(--wp--preset--color--secondary);
}

/**
 * Currently table styles are only available with 'wp-block-styles'
 * theme support (block css) thus the following needs to be included
 * since 'wp-block-styles' aren't used for this theme.
 * https://github.com/WordPress/gutenberg/issues/45065
 */
.wp-block-table thead {
	border-bottom: 3px solid;
}
.wp-block-table tfoot {
	border-top: 3px solid;
}
.wp-block-table td,
.wp-block-table th {
	padding: var(--wp--preset--spacing--30);
	border: 1px solid;
	word-break: normal;
}
.wp-block-table figcaption {
	font-size: var(--wp--preset--font-size--small);
	text-align: center;
}

/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
	text-decoration-thickness: .02em !important;
	text-underline-offset: .25em;
}

.wp-block-button__link {
	border-radius: 0 !important;
}

.home img,
.archive img,
.search img {
	filter: grayscale(100%) !important;
}

/* === Force side-by-side with 35% first button in Fewer theme === */
.wp-block-buttons.custom-equal-buttons {
  display: flex !important;               /* Reinforce flex (already from is-layout-flex) */
  flex-wrap: nowrap !important;           /* CRITICAL: Prevent wrapping/stacking until very narrow */
  flex-direction: row;                    /* Explicit row */
  gap: 1rem !important;
  width: 100% !important;
  align-items: center;                    /* Vertical center alignment */
  justify-content: flex-start;            /* Align left */
  min-width: 0;                           /* Allow shrinking if needed */
  box-sizing: border-box;
}

/* First button: fixed ~35%, won't shrink much */
.wp-block-buttons.custom-equal-buttons .wp-block-button:not(.custom-fill-remaining) {
  flex: 0 0 35% !important;
  max-width: 35% !important;
  min-width: 200px !important;            /* Floor to prevent too-narrow on medium screens */
}

/* Second button: fill remaining space, can shrink a bit */
.wp-block-buttons.custom-equal-buttons .wp-block-button.custom-fill-remaining {
  flex: 1 1 auto !important;              /* Grow to fill, basis auto for content */
  min-width: 0 !important;
}

/* Button links: fill fully, center, control height/padding */
.wp-block-buttons.custom-equal-buttons .wp-block-button__link {
  flex: 1 !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center;
  box-sizing: border-box !important;
  padding: 0.8rem 1.3rem !important;      /* Balanced height (~44–50px) + space for text */
  line-height: 1.4 !important;
  min-height: unset !important;
  height: auto !important;
  font-size: 1rem !important;
}

/* Safety for first button text fit */
.wp-block-buttons.custom-equal-buttons .wp-block-button:not(.custom-fill-remaining) .wp-block-button__link {
  padding-left: 1.2rem !important;
  padding-right: 1.2rem !important;
}

/* Hide empty <p> */
.wp-block-buttons.custom-equal-buttons p:empty {
  display: none !important;
}

/* Mobile: Allow stacking only on very small screens (e.g., <480px phones) */
@media (max-width: 480px) {
  .wp-block-buttons.custom-equal-buttons {
    flex-wrap: wrap !important;           /* Allow stacking when no room */
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .wp-block-buttons.custom-equal-buttons .wp-block-button {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
  }

  .wp-block-buttons.custom-equal-buttons .wp-block-button__link {
    padding: 1rem 1.5rem !important;     /* Larger touch area */
  }
}
