/* IXXO Cart 8 storefront: the Columns section (Moda theme phase Task 7, spec part B), shared by every theme.
   Templates: content/templates/storefront/sections/columns/ (section.php, block.php), column_block/. Tokens only and
   logical properties: the grid follows the page's direction, so a right-to-left page starts on the right. */

/* Two or three columns at the chosen ratio; an empty column keeps its cell, so the others keep their width. */
.sf-columns{ display: grid; gap: 32px; align-items: start; }
.sf-columns--half_half{ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sf-columns--third_two_thirds{ grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.sf-columns--two_thirds_third{ grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.sf-columns--thirds{ grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* A column: its children one under the other, and a size container for the sections inside it. */
.sf-column{ display: flex; flex-direction: column; gap: 20px; min-inline-size: 0; container-type: inline-size; }
/* A child never takes its Columns section's Space above (Section style, home.css): the column
   spaces its children. */
.sf-column{ --sf-space-top: 1; }
/* A block's section wrapper adds no box: the block is the column's own item, as themes' column rules expect. */
.sf-section--column_block{ display: contents; }
/* The column's gap spaces its children, not their own section gap. */
.sf-column .sf-sec{ margin-block-start: 0; }
.sf-column-block{ margin: 0; min-inline-size: 0; }
.sf-column-picture img, .sf-column-video video{ display: block; inline-size: 100%; block-size: auto; border-radius: var(--r); }
.sf-column-picture a{ display: block; }
/* A YouTube or Vimeo player: the column's width at 16:9. */
.sf-column-player iframe{ display: block; inline-size: 100%; aspect-ratio: 16 / 9; block-size: auto; border: 0; border-radius: var(--r); }
.sf-column-button{ display: flex; }
/* One product: a single card filling the column. */
.sf-column-product .sf-grid{ grid-template-columns: minmax(0, 1fr); }
/* A slideshow is no .sf-sec, and carries its own section gap in either style. */
.sf-column .sf-slideshow, .sf-column .sf-progress{ margin-block-start: 0; }

/* A column in a colour scheme other than Page is a panel (Section styles phase): the scheme block
   (/theme.css) paints its ground and re-points the colour tokens inside it; the boxes with a ground of
   their own take the page's colours back by the shared colour scheme rules (components.css). A panel
   with nothing in it keeps its cell, so the others keep their width, but shows no ground; on a
   phone it goes, as any empty column does (below). `.sf-columns >` outweighs the scheme block's ground. */
.sf-column--panel{ padding: 32px; border-radius: calc(var(--r) * 1.5); }
.sf-columns > .sf-column--panel:empty{ background: none; padding: 0; }
/* A panel whose every child Show on hides at this width (home.css, 768px) is as good as empty, and
   :empty cannot see that, so it drops its ground there too. */
@media (min-width: 768px){ .sf-columns > .sf-column--panel:not(:has(> :not(.sf-show-phone))){ background: none; padding: 0; } }
@media (max-width: 767px){ .sf-columns > .sf-column--panel:not(:has(> :not(.sf-show-computer))){ background: none; padding: 0; } }

/* Phones: the columns stack in reading order, column 1 first. */
@media (max-width: 720px){
	.sf-columns--half_half, .sf-columns--third_two_thirds, .sf-columns--two_thirds_third, .sf-columns--thirds{ grid-template-columns: minmax(0, 1fr); }
	.sf-column:empty{ display: none; }
	.sf-column--panel{ padding: 24px; }
}

/* A section in a column goes by the column's width, not the window's: the rules it follows on a
   phone, here for every theme. Each selector starts at .sf-column so it outweighs a theme's rule for
   the same element, whichever stylesheet comes last (a section brings its own in the page's body).
   Not a look's open card: that stands in the window, so looks.css keeps its window-width rule. */
@container (max-width: 720px){
	.sf-column .sf-section--product_row .sf-sec > .sf-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 12px; }
	.sf-column .sf-section--product_row .sf-carousel > .sf-grid{ grid-template-columns: none; grid-auto-columns: calc((100% - 2 * 16px) / 3); }
	/* The Season strip as on a phone: the heading over its text, two rows of six months, three cards a row. */
	.sf-column .sf-season-box{ padding: 28px 20px; }
	.sf-column .sf-season-head{ grid-template-columns: minmax(0, 1fr); }
	.sf-column .sf-season-months{ grid-template-columns: repeat(6, minmax(0, 1fr)); }
	.sf-column .sf-season-box > .sf-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 12px; }
	/* The words get the same room in every theme, whatever a theme gives them beside a picture. */
	.sf-column .sf-iwt{ grid-template-columns: minmax(0, 1fr); gap: 0; }
	.sf-column .sf-iwt-end .sf-iwt-media{ order: 0; }
	.sf-column .sf-iwt-copy{ padding: 24px 20px; }
	.sf-column .sf-iwt-chat{ padding: 24px; }
	.sf-column .sf-statement{ display: block; padding-block: 32px; }
	.sf-column .sf-statement-title{ font-size: 32px; }
	.sf-column .sf-statement-line{ max-inline-size: 56ch; margin-block-start: 20px; }
	.sf-column .sf-progress-slide{ grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 0; padding-inline: 0; }
	.sf-column .sf-progress-media{ aspect-ratio: 4 / 3; block-size: auto; min-block-size: 0; margin-block-start: 0; margin-inline: 0; }
	.sf-column .sf-progress-copy{ order: 0; padding-block: 28px 20px; padding-inline: 16px; }
	.sf-column .sf-progress-title{ font-size: 32px; }
	.sf-column .sf-progress-controls{ position: static; padding-block-end: 20px; padding-inline: 16px; gap: 10px; }
	.sf-column .sf-progress-bars{ gap: 10px; }
}

@container (max-width: 480px){
	.sf-column .sf-section--product_row .sf-sec > .sf-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sf-column .sf-section--product_row .sf-carousel > .sf-grid{ grid-auto-columns: 72%; }
	.sf-column .sf-season-box > .sf-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
	/* Arrows would cover a narrow slide, so where it has dots they go and each dot gets 44px to tap,
	   wrapping onto a second line if it must. With no dots the arrows stay, at the top,
	   clear of the words: they are all there is to press. slideshow.css hides them on a phone, so this also shows them there. */
	.sf-column .sf-slideshow-arrow:not([hidden]){ display: grid; inset-block-start: 8px; translate: none; }
	.sf-column .sf-slideshow-arrow--prev{ inset-inline-start: 6px; }
	.sf-column .sf-slideshow-arrow--next{ inset-inline-end: 6px; }
	.sf-column .sf-slideshow:has(.sf-slideshow-dots:not([hidden])) .sf-slideshow-arrow{ display: none; }
	.sf-column .sf-slideshow-dots{ flex-wrap: wrap; inset-block-end: 10px; gap: 0; }
	.sf-column .sf-slideshow-dot{ inline-size: 44px; block-size: 44px; }
	/* Pause stands in the end corner: the dots stop short of it. */
	.sf-column .sf-slideshow:has(.sf-slideshow-pause:not([hidden])) .sf-slideshow-dots{ padding-inline-end: 60px; }
	.sf-column .sf-slideshow-copy, .sf-column .sf-slideshow:has(.sf-slideshow-arrow:not([hidden])) .sf-slideshow-copy{ padding: 24px 20px 52px; }
	.sf-column .sf-slideshow-title{ font-size: 30px; }
	.sf-column .sf-slideshow--medium .sf-slideshow-slide{ block-size: 400px; }
	.sf-column .sf-slideshow--large .sf-slideshow-slide{ block-size: 520px; }
	.sf-column .sf-set-foot > .sf-set-add{ inline-size: 100%; }
	.sf-column .sf-set-img{ inline-size: 56px; block-size: 56px; }
}

/* A third on a tablet, inside a theme's padding: one card a row, and a set's picture and switch
   stand on one line with the product's name under them. */
@container (max-width: 300px){
	.sf-column .sf-section--product_row .sf-sec > .sf-grid{ grid-template-columns: minmax(0, 1fr); }
	/* Three rows of four months, so a four-letter Greek month still fits its cell. */
	.sf-column .sf-season-months{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.sf-column .sf-season-box > .sf-grid{ grid-template-columns: minmax(0, 1fr); }
	.sf-column .sf-set-choice{ flex-wrap: wrap; justify-content: space-between; }
	.sf-column .sf-set-info{ flex-basis: 100%; order: 1; }
	/* Dots may take two lines here. A tab's words have no room: they stay for screen readers. */
	.sf-column .sf-slideshow-copy, .sf-column .sf-slideshow:has(.sf-slideshow-arrow:not([hidden])) .sf-slideshow-copy{ padding-block-end: 96px; }
	.sf-column .sf-progress-label{ position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
}
