/* 2.0.5 UI polish: less "kansli", more compact */

/* 2.7.99.25 / 2162 – `.td-box`-surface borttagen; generisk kortyta ägs inte längre av td-layout.css. */

/* Post-it-styling styrs längre ner (ATVOF-tokens). */

/* Tables: reduce heavy lines and padding */

/* Mobile: render table rows as compact cards */
@media (max-width: 767px){
  body:not(.td-shell-route-unified) .td-table,
  body:not(.td-shell-route-unified) .td-items{
    border-collapse: separate !important;
    border-spacing: 0 var(--td-space-2) !important;
  }
  body:not(.td-shell-route-unified) .td-table thead,
  body:not(.td-shell-route-unified) .td-table tr,
  body:not(.td-shell-route-unified) .td-items tr{
    display:block !important;
    background: var(--td-bg) !important;
    box-shadow: none !important;
    border-radius: var(--td-radius-sm) !important;
    padding: var(--td-space-2) var(--td-space-3) !important;
  }
}


/* =========================================================
   Träningsdagbok – UI-polish för att matcha ATVOF-mockup
   Fokus: luft, mjuka ytor, zebra istället för hårda linjer,
   post-it som lugn markering, 16px radius på action-knappar.
   ========================================================= */

/* Root + design tokens */
.traningsdagbok,
.td-page{
  --td-text: var(--td-color-text);
  --td-text-muted: var(--td-color-text-muted);
  --td-bg: var(--td-color-page-bg);
  --td-surface: var(--td-color-white);
  --td-surface-soft: var(--td-color-surface-muted);
  --td-border: var(--td-color-border-ui);
  --td-accent: var(--td-color-primary);
  --td-accent-hover: var(--td-color-primary-hover);
  --td-zebra: var(--td-color-zebra);
  --td-radius-cta:5px;
  --td-radius-action:16px;
  /* Kortbredd/luft: vissa vyer (t.ex. Utvärdera) blev oönskat "smalare" när pad ökades.
     Vi använder 0 som default och lägger luft inuti specifika komponenter vid behov. */
  --td-card-pad: 16px;
  --td-card-pad-mobile: 16px;
  color: var(--td-text);
  box-sizing: border-box;
  overflow-x: hidden; /* fångar breddspill utan att skapa ”ful remsa” */
}

.traningsdagbok *,
.td-page *{
  box-sizing: border-box;
}

/* 2.7.99.26 / 2162 – `.td-wrap` bär inte längre global contentbredd/padding; page-frame/content-owner äger den geometri som används live. */

/* Generisk kortyta/padding ägs av td-card.css och td-content-compat.css. td-layout.css sätter inte längre bred card/panel-box-ownership. */

/* Post-it: ”Viktigast just nu” */
body:not(.td-shell-route-unified).traningsdagbok .td-important-now,
body:not(.td-shell-route-unified).traningsdagbok .td-highlight-note,
body:not(.td-shell-route-unified).td-page .td-important-now,
body:not(.td-shell-route-unified).td-page .td-highlight-note{
  background: var(--td-shell-surface-postit);
  border: 1px solid var(--td-shell-postit-border);
  border-radius: var(--td-radius-action);
  box-shadow:none;
}

/* Tabeller/listor: zebra-ränder, minimalt med borders */
.traningsdagbok table,
.td-page table{
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.traningsdagbok table th,
.traningsdagbok table td,
.td-page table th,
.td-page table td{
  padding: 12px 14px;
  vertical-align: middle;
  border: 0 !important;
}

.traningsdagbok table tbody tr:nth-child(even),
.td-page table tbody tr:nth-child(even){
  background-color: var(--td-zebra);
}

.traningsdagbok table tbody tr,
.td-page table tbody tr{
  box-shadow:none;
}


/* Inputs: mjukare */
.traningsdagbok input[type="text"],
.traningsdagbok input[type="search"],
.traningsdagbok select,
.traningsdagbok textarea,
.td-page input[type="text"],
.td-page input[type="search"],
.td-page select,
.td-page textarea{
  border-radius: 12px;
  border: 1px solid var(--td-border);
  background: var(--td-surface);
  padding: 10px 12px;
}

.traningsdagbok input[type="text"]:focus,
.traningsdagbok input[type="search"]:focus,
.traningsdagbok select:focus,
.traningsdagbok textarea:focus,
.td-page input[type="text"]:focus,
.td-page input[type="search"]:focus,
.td-page select:focus,
.td-page textarea:focus{
  outline: 2px solid var(--td-color-focus-outline);
  outline-offset: 2px;
}

/* Knappar i TD: 16px radie (globala CTA hanteras via tema/CTA-regel) */
.traningsdagbok button,
.traningsdagbok .button,
.traningsdagbok a.button,
.traningsdagbok .elementor-button,
.td-page button,
.td-page .button,
.td-page a.button,
.td-page .elementor-button{
  border-radius: var(--td-radius-action) !important;
}

/* Bilder/tabeller ska aldrig spilla ut */
.traningsdagbok img,
.traningsdagbok table,
.td-page img,
.td-page table{
  max-width: 100%;
}


/* =========================================================
   WooCommerce – ATVOF cleanup (sitewide)
   ========================================================= */

/* Stoppa “Title Case” / text-transform: capitalize */
.woocommerce h1,
.woocommerce h2,
.woocommerce h3,
.woocommerce h4,
.woocommerce h5,
.woocommerce h6,
.woocommerce .product_title,
.woocommerce .woocommerce-products-header__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce .related > h2,
.woocommerce .upsells > h2,
.woocommerce .cross-sells > h2{
  text-transform: none;
}

.traningsdagbok .woocommerce a.button,
.traningsdagbok .woocommerce button.button,
.traningsdagbok .woocommerce input.button,
.traningsdagbok .woocommerce button.single_add_to_cart_button,
.traningsdagbok .woocommerce a.checkout-button,
.td-page .woocommerce a.button,
.td-page .woocommerce button.button,
.td-page .woocommerce input.button,
.td-page .woocommerce button.single_add_to_cart_button,
.td-page .woocommerce a.checkout-button{
  text-transform: none;
}

/* Produktsidan: Tabs */
.woocommerce div.product .woocommerce-tabs{
  background: transparent;
  border: 0;
  margin-top: 24px;
}

.woocommerce div.product .woocommerce-tabs ul.tabs{
  margin: 0 0 16px 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li{
  border: 0;
  background: transparent;
  margin: 0 8px 0 0;
  padding: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a{
  display: inline-block;
  padding: 10px 14px;
  border-radius: 16px;
  color: var(--td-color-text);
  background: var(--td-color-surface-muted);
  text-decoration: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a{
  background: var(--td-color-white);
  box-shadow:none;
}

.woocommerce div.product .woocommerce-tabs .panel{
  background: var(--td-color-white);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid var(--td-color-border-ui);
  margin: 0;
}

.woocommerce div.product .woocommerce-tabs .panel h2,
.woocommerce div.product .woocommerce-tabs .panel h3{
  margin-top: 0;
  margin-bottom: 12px;
  text-transform: none;
}

/* Woo-knappar (ATVOF-stil) – endast i TD-skal */
.traningsdagbok .woocommerce a.button,
.traningsdagbok .woocommerce button.button,
.traningsdagbok .woocommerce input.button,
.traningsdagbok .woocommerce #respond input#submit,
.traningsdagbok .woocommerce a.add_to_cart_button,
.traningsdagbok .woocommerce button.single_add_to_cart_button,
.traningsdagbok .woocommerce a.checkout-button,
.td-page .woocommerce a.button,
.td-page .woocommerce button.button,
.td-page .woocommerce input.button,
.td-page .woocommerce #respond input#submit,
.td-page .woocommerce a.add_to_cart_button,
.td-page .woocommerce button.single_add_to_cart_button,
.td-page .woocommerce a.checkout-button{
  border-radius: var(--td-radius-action);
  padding: 14px 28px;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.3px;
  background: var(--td-color-primary);
  color: var(--td-color-white);
  border: 0;
  box-shadow: none;
  text-decoration: none;
}

.traningsdagbok .woocommerce a.button:hover,
.traningsdagbok .woocommerce button.button:hover,
.traningsdagbok .woocommerce input.button:hover,
.traningsdagbok .woocommerce #respond input#submit:hover,
.traningsdagbok .woocommerce a.add_to_cart_button:hover,
.traningsdagbok .woocommerce button.single_add_to_cart_button:hover,
.traningsdagbok .woocommerce a.checkout-button:hover,
.td-page .woocommerce a.button:hover,
.td-page .woocommerce button.button:hover,
.td-page .woocommerce input.button:hover,
.td-page .woocommerce #respond input#submit:hover,
.td-page .woocommerce a.add_to_cart_button:hover,
.td-page .woocommerce button.single_add_to_cart_button:hover,
.td-page .woocommerce a.checkout-button:hover{
  background: var(--td-color-primary-hover);
  color: var(--td-color-white);
}

.traningsdagbok .woocommerce a.button.alt,
.traningsdagbok .woocommerce button.button.alt,
.traningsdagbok .woocommerce input.button.alt,
.td-page .woocommerce a.button.alt,
.td-page .woocommerce button.button.alt,
.td-page .woocommerce input.button.alt{
  background: transparent;
  color: var(--td-color-primary);
  border: 2px solid var(--td-color-primary);
}

.traningsdagbok .woocommerce a.button.alt:hover,
.traningsdagbok .woocommerce button.button.alt:hover,
.traningsdagbok .woocommerce input.button.alt:hover,
.td-page .woocommerce a.button.alt:hover,
.td-page .woocommerce button.button.alt:hover,
.td-page .woocommerce input.button.alt:hover{
  background: var(--td-color-primary);
  color: var(--td-color-white);
}

.woocommerce .product_meta,
.woocommerce div.product form.cart{
  border: 0;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price{
  color: var(--td-color-text);
}


/* =========================================================
   Träningsdagbok – ATVOF-mockup (styrande overrides)
   Lämnas sist i filen för att vinna över tidigare regler.
   ========================================================= */

/* Root-variabler enligt mockup */
.traningsdagbok{
  --td-text: var(--td-color-text);
  --td-text-muted: var(--td-color-text-muted);

  --td-bg: var(--td-color-page-bg);
  --td-surface: var(--td-color-white);
  --td-surface-soft: var(--td-color-surface-muted);
  --td-border: var(--td-color-border-ui);

  --td-accent: var(--td-color-primary);
  --td-accent-hover: var(--td-color-primary-hover);

  --td-zebra: var(--td-color-zebra);

  --td-radius-cta:5px;
  --td-radius-action:16px;
  --td-card-pad: 16px;
  --td-card-pad-mobile: 16px;
}

/* Ta bort "död yta" och gör symmetrisk container */


@media (max-width:768px){
}

.td-plan-this-week{margin:0 0 16px;}
/* Planera: undvik td-section-padding som gör inner-korten smalare än rubrikerna */
.td-plan-this-week{background:transparent !important;padding:0 !important;border-radius:0 !important;}

/* 2.7.99.24 / 2162 – generisk td-card/td-panel/td-box-surface ägs inte längre av td-layout; owner ligger i td-card.css + td-content-compat.css. */

/* Post-it (Viktigast just nu) */

@media (max-width:768px){
}

/* Tabeller: zebra istället för hårda linjer */


/* Inputs */


/* Action-knappar i TD ska vara 16px */

/* Fix: grå "ram" (filter/form-paneler) – ska inte ha border */

/* Fix: breddspill som skapar ojämna kanter */



/* 1336: Delningsstatus-ikoner i listvy – gör status + kopiera identiska (ingen ram/bakgrund) */
.td-share-meta 
.td-share-meta .dashicons{font-size:18px;line-height:1;}






/* Mallar: se till att dashicons inte blir nedärvt osynligt */
.td-create-item-actions 



.td-create-item-actions{
  display:grid !important;
  grid-template-columns: 40px 40px !important;
  gap:8px !important;
  justify-content:end !important;
  align-items:center !important;
}




/* Mallar: radlayout (titel + actions) – ersätter td-row (flex) för stabilt grid */

/* Mallar: actions i två fasta kolumner (pdf + skapa) */

/* Ikonknappar: samma storlek och centrerad ikon */
.td-create-picker 




/* Mallar (desktop): om td-row (flex) ändå ligger kvar, tvinga grid med högre specificitet */
.td-create-picker .td-row.td-create-item-row{
  display:grid !important;
  grid-template-columns: 1fr 96px !important;
  align-items:center !important;
  gap:12px !important;
}



/* Mallar: tvinga actions till högerkant även om row blir flex av tema */






/* 1481: Veckoplanering form/edit – håll övningar + veckans träningspass i samma visuella kort. */
.td-weekplan-inline-note,
.td-weekplan-inline-section{
  margin: 12px 0 !important;
  padding: 12px 0 0 !important;
  border-top: 1px solid var(--td-color-divider-black-08);
}

.td-weekplan-inline-section > h3,
.td-weekplan-inline-note > strong{
  display:block;
  margin:0 0 8px 0;
}

.td-weekplan-exercises-inline ul,
.td-weekplan-trainingpasses-inline ul{
  margin-bottom: 0;
}

/* 1621: weekplan/freetext – inline sektioner och visningsblock ska ligga i samma visuella kort */
.td-weekplan-inline-section,
.td-weekplan-inline-note,
.td-weekplan-exercises-view{
  grid-column: 1 / -1;
  width: 100%;
}

.td-weekplan-inline-note,
.td-weekplan-exercises-view,
#td-weekplan-trainingpasses.td-weekplan-inline-section,
#td-weekplan-exercises.td-weekplan-inline-section{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--td-color-divider-black-08);
}


.td-entry-answer-block:first-of-type{
  border-top: 0;
  padding-top: 0;
}

.td-entry-answer-block__answer > :first-child{margin-top:0;}
.td-entry-answer-block__answer > :last-child{margin-bottom:0;}


/* 2.7.99.35 / 2162 – unified shell rows never become card-surfaces. */
body.td-shell-route-unified table tbody tr,
body.td-shell-route-unified .td-table tbody tr,
body.td-shell-route-unified .td-items tbody tr{
  box-shadow:none !important;
  background-image:none !important;
}


/* 2.7.102.14 – template picker/layout ägs av td-layout.
   Radrutnätet håller titel + åtgärdsknappar i samma vertikala rytm på mobil och desktop. */
.td-create-picker__group{
  display:grid !important;
  gap:18px !important;
}

.td-create-item{
  width:100% !important;
}

.td-create-item-row{
  display:grid !important;
  grid-template-columns:minmax(0, 1fr) auto !important;
  align-items:center !important;
  gap:14px !important;
}

.td-create-item-title{
  min-width:0 !important;
}

.td-create-item-actions{
  display:grid !important;
  grid-auto-flow:column !important;
  grid-auto-columns:44px !important;
  gap:12px !important;
  justify-content:end !important;
  align-items:center !important;
  align-self:center !important;
}

.td-create-picker__footer{
  margin-top:18px !important;
}

@media (min-width:782px){
  .td-create-item-row{
    grid-template-columns:minmax(0, 1fr) 100px !important;
    gap:16px !important;
  }

  .td-create-item-actions{
    grid-auto-columns:44px !important;
    gap:12px !important;
  }
}
