/*
Theme Name: Rúmföt
Theme URI: https://rumfot.is
Description: Custom block theme for Rúmföt.is — calm, Nordic, linen and heather.
Version: 1.1.1
Requires at least: 6.6
Requires PHP: 8.1
License: Proprietary (theme code). Bundled fonts: SIL Open Font License 1.1 (see assets/fonts).
Text Domain: rumfot
*/

/* Small refinements theme.json can't express. Keep this file short. */

/* Sticky, slightly translucent header */
.rf-header {
	position: sticky;
	top: 0;
	z-index: 50;
	backdrop-filter: saturate(140%) blur(8px);
	background-color: color-mix(in srgb, var(--wp--preset--color--base) 88%, transparent);
}

/* Wordmark: serif name with a quiet ".is" */
.rf-wordmark { letter-spacing: -0.01em; }
.rf-wordmark .rf-tld { color: var(--wp--preset--color--accent); font-style: italic; }

/* Hairline rule used between sections */
.rf-rule { border: 0; border-top: 1px solid var(--wp--preset--color--line); }

/* Category tiles: gentle lift on hover */
.rf-tile { transition: transform .35s ease, box-shadow .35s ease; }
.rf-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 30px -18px rgb(35 38 43 / .45); }
.rf-tile a { text-decoration: none; }
.rf-tile a::after { content: ""; position: absolute; inset: 0; } /* whole tile clickable */
.rf-tile { position: relative; }

/* Small uppercase eyebrow label */
.rf-eyebrow {
	text-transform: uppercase;
	letter-spacing: .14em;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	color: var(--wp--preset--color--accent);
}

/* Woven-linen texture for sand sections (pure CSS, no image) */
.rf-linen {
	background-image:
		repeating-linear-gradient(0deg, rgb(35 38 43 / .025) 0 1px, transparent 1px 3px),
		repeating-linear-gradient(90deg, rgb(35 38 43 / .02) 0 1px, transparent 1px 4px);
}

/* Product cards */
.wc-block-product .wc-block-components-product-image img,
.wp-block-woocommerce-product-image img { border-radius: 2px; }
.wc-block-components-product-price { font-variant-numeric: tabular-nums; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	.rf-tile, .rf-tile:hover { transition: none; transform: none; }
}

/* Header search: plain icon button, not a filled block */
.rf-header .wp-block-search__button {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	padding: 0.35rem;
	border: 0;
	min-width: 0;
}
.rf-header .wp-block-search__button:hover { color: var(--wp--preset--color--accent); }
.rf-header .wp-block-search__button svg { width: 22px; height: 22px; fill: currentColor; }
.rf-header .wp-block-search__input { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); }

/* Full-width hairline (WP's default separator styling shrinks it) */
hr.rf-rule { width: 100%; max-width: none; height: 0; background: none; opacity: 1; }

/* Product grid: add-to-cart aligned with the text above it */
.wc-block-components-product-button { justify-content: flex-start; align-items: flex-start; }
.wc-block-components-product-button .wp-block-button__link { margin-inline: 0; }

/* Sort dropdown */
.woocommerce-ordering select,
.wc-block-catalog-sorting select {
	appearance: none;
	background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2323262B' stroke-width='1.3'/%3E%3C/svg%3E") no-repeat right .6rem center;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 2px;
	padding: .45rem 2rem .45rem .75rem;
	font: inherit;
	color: var(--wp--preset--color--contrast);
}

/* ---- Category sidebar (rumfot/category-sidebar) ---- */
.rf-catnav__title {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.1;
	margin: 0 0 var(--wp--preset--spacing--30);
}
.rf-catnav__list, .rf-catnav__sub { list-style: none; margin: 0; padding: 0; }
.rf-catnav__item a {
	display: block;
	padding: .45rem 0 .45rem .9rem;
	border-left: 2px solid var(--wp--preset--color--line);
	text-decoration: none;
	color: var(--wp--preset--color--contrast-2);
	font-size: var(--wp--preset--font-size--small);
}
.rf-catnav__item a:hover { color: var(--wp--preset--color--contrast); border-left-color: var(--wp--preset--color--accent-2); }
.rf-catnav__item.is-active > a { color: var(--wp--preset--color--contrast); font-weight: 600; }
.rf-catnav__item > a[aria-current="page"] { border-left-color: var(--wp--preset--color--accent); color: var(--wp--preset--color--accent); }
.rf-catnav__sub .rf-catnav__item a { padding-left: 1.7rem; font-size: var(--wp--preset--font-size--x-small); }
.rf-catnav__back {
	display: inline-block;
	margin-top: var(--wp--preset--spacing--40);
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--contrast-2);
}
.rf-shop-sidebar { position: sticky; top: 6rem; align-self: flex-start; }

/* Phones: sidebar becomes a horizontally scrolling row of chips above the products */
@media (max-width: 781px) {
	.rf-shop-sidebar { position: static; }
	.rf-catnav__title { font-size: var(--wp--preset--font-size--large); }
	.rf-catnav__list { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
	.rf-catnav__sub { display: none; }
	.rf-catnav__item a {
		white-space: nowrap;
		border: 1px solid var(--wp--preset--color--line);
		border-radius: 999px;
		padding: .4rem .9rem;
		background: var(--wp--preset--color--surface);
	}
	.rf-catnav__item > a[aria-current="page"] { background: var(--wp--preset--color--contrast); border-color: var(--wp--preset--color--contrast); color: var(--wp--preset--color--surface); }
	.rf-catnav__back { display: none; }
}

/* Sidebar title quieter than the page title */
.rf-catnav__title { font-size: var(--wp--preset--font-size--large); color: var(--wp--preset--color--contrast-2); }
/* Product buttons: no wrapping on narrow cards */
@media (max-width: 781px) {
	.wc-block-components-product-button .wp-block-button__link { letter-spacing: .06em; padding-inline: .9rem; white-space: nowrap; }
}
