/*
Theme Name: Artetto
Theme URI: https://artetto.com
Author: Artetto
Author URI: https://artetto.com
Description: Custom theme for artetto.com in English, German and Turkish. Personalized products, AI art and digital downloads. Built on the Artetto brand guide (colors, fonts, buttons), with a ready-made front page, a language switcher and WooCommerce support.
Version: 1.3.1
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: artetto
Domain Path: /languages
Tags: e-commerce, custom-logo, custom-menu, featured-images, translation-ready, accessibility-ready, block-styles, wide-blocks
*/

/* ==========================================================================
   1. Tokens (same values as artetto-tokens.css from the brand guide)
   ========================================================================== */
:root {
  --artetto-violet: #5B3DF5;
  --artetto-coral: #FF5A3C;
  --artetto-ink: #15132B;
  --artetto-cream: #FFF8EF;
  --artetto-mist: #EFEAFB;
  --artetto-sun: #FFC83D;
  --artetto-slate: #6A6785;
  --artetto-violet-light: #A99CFF;
  --artetto-white: #FFFFFF;
  --artetto-border: #E4DEF2;

  /* Hover states derived from the brand colors */
  --artetto-violet-hover: #4A2FDB;
  --artetto-coral-hover: #F24A2B;

  --artetto-font-display: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --artetto-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --artetto-radius-card: 20px;
  --artetto-radius-tile: 16px;
  --artetto-radius-button: 999px;

  --artetto-shadow: 0 1px 2px rgba(21, 19, 43, .06), 0 14px 34px -14px rgba(21, 19, 43, .22);
  --artetto-shadow-lg: 0 2px 4px rgba(21, 19, 43, .06), 0 30px 60px -24px rgba(21, 19, 43, .35);

  --artetto-container: 1200px;
  --artetto-gutter: clamp(18px, 4vw, 40px);
  --artetto-header-h: 80px;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--artetto-header-h) + 16px);
}

body {
  margin: 0;
  background: var(--artetto-cream);
  color: var(--artetto-ink);
  font-family: var(--artetto-font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, video, canvas { max-width: 100%; height: auto; }
svg { max-width: 100%; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .55em;
  font-family: var(--artetto-font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--artetto-ink);
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); letter-spacing: -.01em; }
h4 { font-size: 1.15rem; letter-spacing: -.005em; }

p { margin: 0 0 1.1em; }
a { color: var(--artetto-violet); text-underline-offset: .2em; }
a:hover { color: var(--artetto-violet-hover); }
hr { border: 0; border-top: 1px solid var(--artetto-border); margin: 2.5rem 0; }
strong, b { font-weight: 600; }
::selection { background: var(--artetto-violet); color: #fff; }

:focus-visible {
  outline: 3px solid var(--artetto-violet);
  outline-offset: 3px;
  border-radius: 6px;
}
.on-dark :focus-visible,
.site-footer :focus-visible { outline-color: var(--artetto-violet-light); }
/* Violet surfaces: a violet ring would disappear, so use cream there. */
.way--ai :focus-visible,
.cta :focus-visible { outline-color: var(--artetto-cream); }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 1000;
  padding: 12px 20px;
  border-radius: var(--artetto-radius-button);
  background: var(--artetto-ink);
  color: var(--artetto-cream);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 16px; color: var(--artetto-cream); }

.container {
  width: min(100% - 2 * var(--artetto-gutter), var(--artetto-container));
  margin-inline: auto;
}
.container--narrow { width: min(100% - 2 * var(--artetto-gutter), 780px); }

/* ==========================================================================
   3. Buttons (brand guide: pill shape, 600 weight)
   ========================================================================== */
.btn,
.wp-block-button__link,
.wp-element-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 52px;
  padding: 16px 28px;
  border: 2px solid transparent;
  border-radius: var(--artetto-radius-button);
  font-family: var(--artetto-font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }

/* Main button: violet with white text (contrast 6.12) */
.btn--primary,
.wp-block-button__link,
.wp-element-button {
  background: var(--artetto-violet);
  color: var(--artetto-white);
}
.btn--primary:hover,
.wp-block-button__link:hover,
.wp-element-button:hover {
  background: var(--artetto-violet-hover);
  color: var(--artetto-white);
  box-shadow: 0 12px 26px -12px rgba(91, 61, 245, .8);
}

/* Action button: coral with INK text (contrast 5.84). Never white text on coral. */
.btn--action {
  background: var(--artetto-coral);
  color: var(--artetto-ink);
}
.btn--action:hover {
  background: var(--artetto-coral-hover);
  color: var(--artetto-ink);
  box-shadow: 0 12px 26px -12px rgba(255, 90, 60, .9);
}

.btn--ghost {
  background: transparent;
  border-color: var(--artetto-ink);
  color: var(--artetto-ink);
}
.btn--ghost:hover { background: var(--artetto-ink); color: var(--artetto-cream); }

.btn--light {
  background: var(--artetto-cream);
  color: var(--artetto-ink);
}
.btn--light:hover { background: var(--artetto-white); color: var(--artetto-ink); }

.btn--ghost-light {
  background: transparent;
  border-color: rgba(255, 255, 255, .75);
  color: var(--artetto-white);
}
.btn--ghost-light:hover { background: var(--artetto-white); color: var(--artetto-ink); }

.btn--lg { min-height: 58px; padding: 18px 34px; font-size: 1.0625rem; }
.btn--sm { min-height: 44px; padding: 11px 22px; font-size: .9375rem; }
.btn--block { display: flex; width: 100%; }

/* ==========================================================================
   4. Forms
   ========================================================================== */
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="search"], input[type="tel"], input[type="number"], input[type="date"],
select, textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 1.5px solid var(--artetto-slate);
  border-radius: 14px;
  background: var(--artetto-white);
  color: var(--artetto-ink);
  font-family: var(--artetto-font-body);
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--artetto-violet);
  box-shadow: 0 0 0 4px rgba(91, 61, 245, .22);
}
::placeholder { color: var(--artetto-slate); opacity: 1; }
label { font-weight: 600; font-size: .9375rem; }

.search-form { display: flex; gap: 10px; align-items: stretch; }
.search-form input[type="search"] { border-radius: var(--artetto-radius-button); padding-inline: 22px; }
.search-form .btn { flex: none; }

/* ==========================================================================
   5. Header
   ========================================================================== */
.announcement {
  background: var(--artetto-ink);
  color: var(--artetto-cream);
  font-size: .9375rem;
  font-weight: 500;
  text-align: center;
  padding: 10px var(--artetto-gutter);
}
.announcement a { color: var(--artetto-violet-light); font-weight: 600; }
.announcement a:hover { color: var(--artetto-white); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 248, 239, .9);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.site-header.is-scrolled {
  border-bottom-color: var(--artetto-border);
  box-shadow: 0 10px 30px -22px rgba(21, 19, 43, .55);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--artetto-header-h);
}
.site-logo { display: block; flex: none; line-height: 0; }
.site-logo img, .site-logo .custom-logo { display: block; width: 150px; height: auto; }

.primary-nav { margin-left: auto; }
.primary-nav ul { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.primary-nav li > a {
  display: block;
  padding: 10px 16px;
  border-radius: var(--artetto-radius-button);
  color: var(--artetto-ink);
  font-size: .9688rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.primary-nav li > a:hover,
/* Active page only. Anchor links such as /#faq are flagged "current" by WordPress on the front page, so they are skipped. */
.primary-nav .current-menu-item > a:not([href*="#"]),
.primary-nav .current_page_item > a:not([href*="#"]) { background: var(--artetto-mist); color: var(--artetto-violet); }
.primary-nav .nav-cta-mobile { display: none; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  color: var(--artetto-ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--artetto-mist); color: var(--artetto-violet); }
.icon-btn svg { width: 24px; height: 24px; }

.cart-count {
  position: absolute;
  top: 2px; right: 0;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--artetto-coral);
  color: var(--artetto-ink);
  font-size: .75rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.cart-count:empty, .cart-count[data-count="0"] { display: none; }

.nav-toggle { display: none; }
.nav-toggle .icon-close { display: none; }
.nav-open .nav-toggle .icon-open { display: none; }
.nav-open .nav-toggle .icon-close { display: block; }
.header-cta { margin-left: 6px; white-space: nowrap; }

/* Language dropdown (header) */
.lang { position: relative; }
.lang__button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 46px;
  padding: 0 10px 0 12px;
  border-radius: var(--artetto-radius-button);
  color: var(--artetto-ink);
  font-size: .875rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.lang__button::-webkit-details-marker { display: none; }
.lang__button::marker { content: ''; }
.lang__button:hover,
.lang[open] > .lang__button { background: var(--artetto-mist); color: var(--artetto-violet); }
.lang__button svg { width: 22px; height: 22px; }
.lang__button .lang__caret { width: 16px; height: 16px; transition: transform .2s ease; }
.lang[open] .lang__caret { transform: rotate(180deg); }
.lang__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 70;
  min-width: 190px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--artetto-white);
  border: 1px solid var(--artetto-border);
  border-radius: var(--artetto-radius-tile);
  box-shadow: var(--artetto-shadow-lg);
}
.lang__menu li { margin: 0; }
.lang__menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--artetto-ink);
  font-weight: 500;
  text-decoration: none;
}
.lang__menu a:hover { background: var(--artetto-mist); color: var(--artetto-violet); }
.lang__menu a[aria-current="true"] { font-weight: 700; }
.lang__menu a svg { width: 18px; height: 18px; color: var(--artetto-violet); }

@media (max-width: 1099px) {
  .nav-toggle { display: grid; }
  .primary-nav {
    position: absolute;
    left: 0; right: 0; top: 100%;
    margin: 0;
    padding: 14px var(--artetto-gutter) 28px;
    background: var(--artetto-cream);
    border-bottom: 1px solid var(--artetto-border);
    box-shadow: 0 30px 40px -30px rgba(21, 19, 43, .5);
    display: none;
  }
  .nav-open .primary-nav { display: block; }
  .primary-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .primary-nav li > a { padding: 14px 16px; font-size: 1.125rem; }
  .primary-nav .nav-cta-mobile { display: block; margin-top: 16px; }
  .header-actions { margin-left: auto; }
  .header-cta { display: none; }
}
@media (max-width: 480px) {
  .site-logo img, .site-logo .custom-logo { width: 128px; }
  .site-header__inner { gap: 8px; }
  /* Small screens: the language button shrinks to the globe. */
  .lang__button { width: 46px; padding: 0; justify-content: center; }
  .lang__code, .lang__button .lang__caret { display: none; }
}
@media (max-width: 380px) {
  /* Four round buttons plus the logo have to fit into 320px. */
  .site-logo img, .site-logo .custom-logo { width: 104px; }
  .site-header__inner { gap: 4px; }
  .header-actions { gap: 0; }
  .icon-btn, .lang__button { width: 40px; height: 40px; }
  .lang__button { height: 40px; }
  .icon-btn svg, .lang__button svg { width: 22px; height: 22px; }
}

/* ==========================================================================
   6. Footer
   ========================================================================== */
.site-footer {
  background: var(--artetto-ink);
  color: var(--artetto-mist);
  margin-top: clamp(64px, 9vw, 120px);
  padding: clamp(56px, 7vw, 96px) 0 32px;
  font-size: .9688rem;
}
.site-footer a { color: var(--artetto-cream); text-decoration: none; }
.site-footer a:hover { color: var(--artetto-violet-light); text-decoration: underline; }
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(2, 1fr);
  gap: clamp(32px, 5vw, 72px);
}
.site-footer__brand img { display: block; width: 170px; height: auto; margin: -8px 0 14px -10px; }
.site-footer__brand p { max-width: 36ch; }
.site-footer h2 {
  margin: 0 0 16px;
  font-family: var(--artetto-font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--artetto-violet-light);
}
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin: 0 0 10px; }
.social-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.social-links a {
  padding: 8px 16px;
  border: 1.5px solid rgba(239, 234, 251, .45);
  border-radius: var(--artetto-radius-button);
  font-size: .875rem;
  font-weight: 500;
}
.social-links a:hover { background: var(--artetto-cream); border-color: var(--artetto-cream); color: var(--artetto-ink); text-decoration: none; }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: 24px;
  border-top: 1px solid rgba(239, 234, 251, .22);
  font-size: .875rem;
}
/* Language list (footer) */
.lang-list { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.lang-list a[aria-current="true"] { color: var(--artetto-white); font-weight: 700; text-decoration: underline; text-underline-offset: 5px; }
@media (max-width: 760px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}

/* ==========================================================================
   7. Content pages, blog and archives
   ========================================================================== */
.page-hero { padding: clamp(40px, 6vw, 80px) 0 clamp(8px, 2vw, 24px); }
.page-hero h1 { margin-bottom: .25em; }
.page-hero p { color: var(--artetto-slate); font-size: 1.125rem; max-width: 60ch; }

.content-area { padding-bottom: 24px; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content { font-size: 1.0625rem; }
.entry-content h2 { margin-top: 1.8em; }
.entry-content h3 { margin-top: 1.5em; }
.entry-content img { border-radius: var(--artetto-radius-tile); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.entry-content li { margin-bottom: .4em; }
.entry-content blockquote {
  margin: 1.8em 0;
  padding: 6px 0 6px 24px;
  border-left: 4px solid var(--artetto-violet);
  font-family: var(--artetto-font-display);
  font-size: 1.35rem;
  line-height: 1.4;
}
.entry-content table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; }
.entry-content th, .entry-content td { padding: 12px 14px; border-bottom: 1px solid var(--artetto-border); text-align: left; }
.entry-content pre, .entry-content code { font-size: .92em; background: var(--artetto-mist); border-radius: 8px; }
.entry-content code { padding: .15em .4em; }
.entry-content pre { padding: 18px; overflow: auto; }
.alignwide { width: min(100vw - 2 * var(--artetto-gutter), var(--artetto-container)); margin-inline: auto; position: relative; left: 50%; transform: translateX(-50%); max-width: none; }
.alignfull { width: 100vw; position: relative; left: 50%; transform: translateX(-50%); max-width: none; }
.wp-caption, figure { margin: 0 0 1.5em; }
figcaption, .wp-caption-text { color: var(--artetto-slate); font-size: .9rem; margin-top: .5em; }

.entry-meta { color: var(--artetto-slate); font-size: .9375rem; margin-bottom: 1.2em; }
.entry-meta a { color: inherit; }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--artetto-white);
  border: 1px solid var(--artetto-border);
  border-radius: var(--artetto-radius-card);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--artetto-shadow); }
.post-card__media { display: block; aspect-ratio: 4 / 3; background: var(--artetto-mist); overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card__body { display: flex; flex-direction: column; flex: 1; padding: 24px; }
.post-card__title { font-size: 1.35rem; margin-bottom: .4em; }
.post-card__title a { color: var(--artetto-ink); text-decoration: none; }
.post-card__title a:hover { color: var(--artetto-violet); }
.post-card__excerpt { color: var(--artetto-slate); font-size: .9688rem; flex: 1; }
.post-card__more { font-weight: 600; text-decoration: none; display: inline-flex; gap: .4em; align-items: center; }
.post-card__more svg { width: 1.1em; height: 1.1em; }

.pagination, .navigation.pagination { margin-top: 48px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.page-numbers {
  display: grid; place-items: center;
  min-width: 46px; height: 46px; padding: 0 14px;
  border-radius: var(--artetto-radius-button);
  background: var(--artetto-white);
  border: 1px solid var(--artetto-border);
  color: var(--artetto-ink);
  font-weight: 600;
  text-decoration: none;
}
a.page-numbers:hover { background: var(--artetto-mist); color: var(--artetto-violet); }
.page-numbers.current { background: var(--artetto-violet); border-color: var(--artetto-violet); color: #fff; }

.post-navigation .nav-links { justify-content: space-between; }

.comments-area { margin-top: 64px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 40px; }
.comment-list .children { list-style: none; padding-left: 28px; }
.comment-body { padding: 20px 24px; margin-bottom: 14px; background: var(--artetto-white); border: 1px solid var(--artetto-border); border-radius: var(--artetto-radius-tile); }
.comment-author .avatar { border-radius: 50%; vertical-align: middle; margin-right: 10px; }
.comment-metadata { font-size: .875rem; color: var(--artetto-slate); }
.comment-metadata a { color: inherit; }
.comment-form p { margin-bottom: 1em; }
.comment-form .submit { background: var(--artetto-violet); color: #fff; border: 0; border-radius: var(--artetto-radius-button); padding: 16px 28px; font-weight: 600; cursor: pointer; }
.comment-form .submit:hover { background: var(--artetto-violet-hover); }

.not-found { text-align: center; padding: clamp(48px, 9vw, 120px) 0; }
.not-found__code {
  font-family: var(--artetto-font-display);
  font-weight: 700;
  font-size: clamp(6rem, 22vw, 14rem);
  line-height: .85;
  letter-spacing: -.05em;
  color: var(--artetto-violet);
  margin: 0 0 .1em;
}
.not-found .search-form { max-width: 520px; margin: 28px auto 0; }

/* Woo-related pages created from normal pages (cart, checkout, account) */
.woo-page .container--narrow { width: min(100% - 2 * var(--artetto-gutter), var(--artetto-container)); }

/* ==========================================================================
   8. Motion preferences
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
